#include using namespace std; int main () { int N, M; cin >> N >> M; vector A(M); for (auto& a : A) { string s; cin >> s; a = 0; for (auto& c : s) { a <<= 1; a |= (c == '1'); } } vector ex((1 << N), 0); for (auto& a : A) ex[a] = 1; bool OK = (ex.back() == 1); for (int i = 0; i < M; i ++) { for (int j = i + 1; j < M; j ++) { if (!ex[A[i] & A[j]]) { OK = false; } } } if (!OK) { puts("No"); return 0; } for (int a = 0; a < (1 << N); a ++) { if (!ex[a]) { int x = 0; for (int b = a; b; b = (b - 1) & a) { if (ex[b]) x |= b; } if (x == a) { puts("No"); return 0; } } } puts("Yes"); }