n, m = map(int, input().split()) X = [0] * n for _ in range(m): A = list(map(int, input().split())) X = [a + x for a, x in zip(A, X)] se = {0} tot = 0 for x in X: tot += x if tot - 777 in se: print("YES") exit() se.add(tot) print("NO")