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

public class ksubset_aa implements Runnable {

	public static void main(String[] args) {
		new Thread(new ksubset_aa()).start();
	}

	public void run() {
		try {
			solve();
		} catch (IOException e) {
		}
	}

	private void MyAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	BufferedReader br;

	StringTokenizer st;

	PrintWriter out;

	boolean eof = false;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	String nextToken(String delim) {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine(), delim);
			} catch (IOException e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken(delim);
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	int nextInt(String delim) {
		return Integer.parseInt(nextToken(delim));
	}

	String FILENAME = "ksubset";

	long[] a, s;

	void solve() throws IOException {
		br = new BufferedReader(new FileReader(FILENAME + ".in"));
		out = new PrintWriter(FILENAME + ".out");
		int n = nextInt();
		MyAssert(0 < n && n <= 10, "n is not in bounds!!!");
		int k = nextInt();
		MyAssert(0 < k && k < 11, "k is not in bounds!!!");
		a = new long[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
			MyAssert(Math.abs(a[i]) <= 1000000000, "a[" + i
					+ "] is not in bounds!!!");
		}
		s = new long[k];
		for (int i = 0; i < s.length; i++) {
			s[i] = nextInt();
			MyAssert(Math.abs(s[i]) <= 1000000000, "s[" + i
					+ "] is not in bounds!!!");
		}
		long[] b = new long[k];
		boolean[] notEmpty = new boolean[k];
		if (DFS(0, a, s, b, notEmpty)) {
			out.println("YES");
		} else {
			out.println("NO");
		}
		out.close();
	}

	private boolean DFS(int x, long[] a, long[] s, long b[], boolean[] bool) {
		if (x == a.length) {
			for (int i = 0; i < b.length; i++) {
				if (b[i] != s[i] || !bool[i]) {
					return false;
				}
			}
			return true;
		}
		for (int i = 0; i < Math.min(x + 1, b.length); i++) {
			b[i] += a[x];
			boolean tmp = bool[i];
			bool[i] = true;
			if (DFS(x + 1, a, s, b, bool)) {
				return true;
			}
			bool[i] = tmp;
			b[i] -= a[x];
		}
		return false;
	}
}
