import sys import bisect readline = sys.stdin.readline N, M = map(int, readline().split()) sums = [0 for _ in range(N)] nums = [0 for _ in range(N + 1)] done = False for _ in range(M): num = 0 nums[0] = 0 for i, n in enumerate(map(int, readline().split())): sums[i] += n nums[i + 1] = sums[i] + num num += sums[i] idx = bisect.bisect_left(nums[:i + 1], nums[i + 1] - 777) if nums[idx] == nums[i + 1] - 777: done = True if done: print('YES') else: print('NO')