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 = 1; i <= n; i++) { arr[i] = sc.nextInt() + arr[i - 1]; } if (check(arr)) { System.out.println("YES"); return; } for (int i = 1; i < m; i++) { int sum = 0; for (int j = 1; j <= n; j++) { int x = sc.nextInt(); 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++) { 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; } }