import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N,M = map(int,readline().split()) As = np.array(read().split(),np.int64).reshape(M,N) np.cumsum(As, out=As, axis=0) def find_777(A): Acum = np.zeros(len(A) + 1) Acum[1:] = np.cumsum(A) x = np.searchsorted(Acum, Acum+777, 'right') x -= np.searchsorted(Acum, Acum+777, 'left') return np.any(x) answer = 'YES' if any(find_777(A) for A in As) else 'NO' print(answer)