n, m = map(int, input().split()) B = [0]*(n+1) from itertools import accumulate for i in range(m): A = list(map(int, input().split())) A = [0]+A A = list(accumulate(A)) for i in range(n+1): B[i] += A[i] s = set() for i in range(n+1): if B[i] - 777 in s: print('YES') exit() else: s.add(B[i]) else: print('NO')