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 int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, m) = (c[0], c[1]); var s = new int[m]; for (var i = 0; i < m; ++i) { var t = ReadLine(); var si = 0; for (var j = 0; j < t.Length; ++j) { si <<= 1; si += t[j] - '0'; } s[i] = si; } WriteLine(Judge(n, m, s) ? "Yes" : "No"); } static bool Judge(int n, int m, int[] s) { var uf = new UnionFindTree(n); var isall1 = Enumerable.Repeat(true, n).ToArray(); for (var l = 0; l < n; ++l) { for (var i = 0; i < m; ++i) { if (((s[i] >> l) & 1) == 0) { isall1[l] = false; break; } } for (var r = l + 1; r < n; ++r) { var flg = true; for (var i = 0; i < m; ++i) { if (((s[i] >> l) & 1) != ((s[i] >> r) & 1)) { flg = false; break; } } if (flg) uf.Unite(l, r); } } var set = new HashSet(s); var bitmax = 1 << n; for (var b = 0; b < bitmax; ++b) { var flg = true; for (var l = 0; l < n; ++l) for (var r = l + 1; r < n; ++r) { if (!flg) break; if (uf.IsSameTree(l, r) && ((b >> l) & 1) != ((b >> r) & 1)) flg = false; } for (var l = 0; l < n; ++l) { if (!flg) break; if (isall1[l] && ((b >> l) & 1) == 0) flg = false; } if (flg && !set.Contains(b)) return false; } return true; } class UnionFindTree { int[] roots; public UnionFindTree(int size) { roots = new int[size]; for (var i = 0; i < size; ++i) roots[i] = -1; } public int GetRoot(int a) { if (roots[a] < 0) return a; return roots[a] = GetRoot(roots[a]); } public bool IsSameTree(int a, int b) { return GetRoot(a) == GetRoot(b); } public bool Unite(int a, int b) { var x = GetRoot(a); var y = GetRoot(b); if (x == y) return false; if (-roots[x] < -roots[y]) { var tmp = x; x = y; y = tmp; } roots[x] += roots[y]; roots[y] = x; return true; } public int GetSize(int a) { return -roots[GetRoot(a)]; } } }