import java.util.*; import java.io.*; public class Main { public static void main (String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] first = br.readLine().split(" ", 2); int n = Integer.parseInt(first[0]); int m = Integer.parseInt(first[1]); int[] arr = new int[n + 1]; String[] second = br.readLine().split(" ", n); for (int i = 1; i <= n; i++) { arr[i] = Integer.parseInt(second[i - 1]) + arr[i - 1]; } if (check(arr)) { System.out.println("YES"); return; } for (int i = 1; i < m; i++) { int sum = 0; String[] line = br.readLine().split(" ", n); for (int j = 1; j <= n; j++) { int x =Integer.parseInt(line[j - 1]); sum += x; arr[j] += sum; } if (check(arr)) { System.out.println("YES"); return; } } System.out.println("NO"); } static boolean check(int[] arr) { for (int i = 1; i < arr.length; i++) { if (arr[i] - arr[i - 1] > 777) { continue; } for (int j = 0; j < i; j++) { if (arr[i] - arr[j] == 777) { return true; } else if (arr[i] - arr[j] < 777) { break; } } } return false; } }