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]; for (int i = 0; i < m; i++) { String[] line = br.readLine().split(" ", n); int[] sums = new int[n + 1]; for (int j = 1; j <= n; j++) { arr[j] += Integer.parseInt(line[j - 1]); sums[j] = sums[j - 1] + arr[j]; } int right = 0; for (int left = 0; left < n; left++) { while (right < n && sums[right] - sums[left] < 777) { right++; } if (sums[right] - sums[left] == 777) { System.out.println("YES"); return; } } } System.out.println("NO"); } }