import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] arr = new int[n + 1]; for (int i = 0; i < m; i++) { for (int j = 1; j <= n; j++) { arr[j] += sc.nextInt(); } int[] sums = new int[n + 1]; for (int j = 1; j <= n; j++) { 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"); } }