using System; using System.Linq; namespace y { class Program { static void Main(string[] args) { string[] ss = Console.ReadLine().Split(); int n = int.Parse(ss[0]); int m = int.Parse(ss[1]); int[] a = new int[n]; bool f = false; for (int i = 0; i < m; i++) { int[] b = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray(); for (int j = 0; j < n; j++) { a[j] += b[j]; } for (int j = 0; j < n; j++) { if (a[j] == 777) { f = true; break; } int r = 0; for (int k = j; k < n; k++) { r += a[k]; } if (r == 777) { f = true; break; } } if (f) break; } if (f) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } }