import java.io.*;
import java.util.*;
import java.math.*;

public class ksubset_vu {
	
	static int n;
	static int k;
	static long[] a;
	static long[] s;
	static long[] d;

	static boolean dfs(int l) {
		if (l == n) {
			for (int i = 0; i < k; i++) {
				if (s[i] != d[i]) {
					return false;
				}
			}
			return true;
		} else {
			for (int i = 0; i < k; i++) {
				d[i] += a[l];
				boolean u = dfs(l++);
				if (u) return true;
				d[i] -= a[l];
			}
			return false;
		}
	}

	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(new File("ksubset.in"));
		PrintWriter out = new PrintWriter(new File("ksubset.out"));
		
		n = in.nextInt();
		k = in.nextInt();
		a = new long[n];
		d = new long[k];
		s = new long[k];
        for (int i = 0; i < n; i++) {
        	a[i] = in.nextInt();
        }
        for (int i = 0; i < k; i++) {
        	s[i] = in.nextInt();
        }
		
		if (dfs(0)) {
			out.print("YES");
		} else {
			out.print("NO");
		}

		in.close();
		out.close();
	}

}