using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, m) = (c[0], c[1]); var count = new int[n]; var cum = new long[n + 1]; var ans = "NO"; for (var i = 0; i < m; ++i) { c = NList; var set = new HashSet { 0 }; for (var j = 0; j < n; ++j) { count[j] += c[j]; cum[j + 1] = cum[j] + count[j]; if (set.Contains(cum[j + 1] - 777)) ans = "YES"; set.Add(cum[j + 1]); } } WriteLine(ans); } }