#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() using namespace std; using lint = long long; int main() { int n, m; cin >> n >> m; auto f = [&](string s) -> int { int res = 0; int cur = 1; rep(i, n) { res += cur * (s[n - i - 1] - '0'); cur *= 2; } return res; }; vector a(m); set s; rep(i, m) { string x; cin >> x; int y = f(x); a[i] = y; s.insert(y); } if (!s.count((1 << n) - 1)) { cout << "No" << endl; return 0; } rep(i, m) rep(j, m) { if (!s.count(a[i] & a[j])) { cout << "No" << endl; return 0; } } rep(bit, (1 << m)) { int cur = 0; rep(i, m) { if (bit & (1 << i)) { cur |= a[i]; } } if (!s.count(cur)) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; }