namespace AtCoder; #nullable enable using System.Numerics; static class Extensions { public static T[] Repeat(this int time, Func F) => Enumerable.Range(0, time).Select(_ => F()).ToArray(); } class AtCoder { object? Solve() { var n = Int(); var m = Int(); var sz = m.Repeat(() => Convert.ToUInt64(String(), 2)); var sh = new HashSet(sz); if (!sh.Contains((1UL << n) - 1)) return false; var andz = new HashSet(); foreach (var s1 in sz) foreach (var s2 in sz) andz.Add(s1 & s2); var sss = new HashSet(); sss.Add(0); foreach (var b in andz) { var nss = new HashSet(); foreach (var bs in sss) { nss.Add(bs); nss.Add(bs | b); } sss = nss; } foreach (var b in sss) if (!sh.Contains(b)) return false; return true; } public static void Main() => new AtCoder().Run(); public void Run() { var res = Solve(); if (res != null) { if (res is bool yes) res = yes ? "Yes" : "No"; sw.WriteLine(res); } sw.Flush(); } string[] input = Array.Empty(); int iter = 0; readonly StreamWriter sw = new(Console.OpenStandardOutput()) { AutoFlush = false }; string String() { while (iter >= input.Length) (input, iter) = (Console.ReadLine()!.Trim().Split(' '), 0); return input[iter++]; } T Input() where T : IParsable => T.Parse(String(), null); int Int() => Input(); void Out(object? x, string? separator = null) { separator ??= Environment.NewLine; if (x is System.Collections.IEnumerable obj and not string) { var firstLine = true; foreach (var item in obj) { if (!firstLine) sw.Write(separator); firstLine = false; sw.Write(item); } } else sw.Write(x); sw.WriteLine(); } }