import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { static TreeSet enables = new TreeSet<>(); static Set disables = new HashSet<>(); public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int a = sc.nextInt(); int b = sc.nextInt(); while (a-- > 0) { enables.add(sc.nextInt()); } boolean enable = true; while (b-- > 0 && enable) { enable = getEnable(sc.nextInt()); } System.out.println(enable ? "Yes" : "No"); } static boolean getEnable(int x) { if (enables.contains(x)) { return true; } if (disables.contains(x)) { return false; } Integer key = x; while ((key = enables.lower(key)) != null) { if (getEnable(x - key)) { enables.add(x); return true; } } disables.add(x); return false; } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }