n, m = map(int, input().split()) deltas = [list(map(int, input().split())) for _ in range(m)] current_s = [0] * n found = False for row in deltas: for j in range(n): current_s[j] += row[j] # Check for subarray sum 777 seen = {0} prefix = 0 for num in current_s: prefix += num if prefix - 777 in seen: found = True break seen.add(prefix) if found: break print("YES" if found else "NO")