#include using namespace std; using ll = long long; #define ALL(v) v.begin(),v.end() #define dbg(x) cerr << #x << ": " << (x) << endl; int n,m; vector a; vector ex; int main() { cin >> n >> m; ex.resize(1 << n); a.resize(m); for (int i = 0; i < m; ++i) { string s; cin >> s; int x = 0; for (int i = 0; i < n; ++i) { if (s[i] == '1') x |= 1 << i; } a[i] = x; ex[x] = true; } int tgt = (1 << n)-1; if (!ex[tgt]) { cout << "No\n"; return 0; } if (!ex[0]) { cout << "No\n"; return 0; } for (int i = 0; i < m; ++i) { for (int j = i+1; j < m; ++j) { if (!ex[a[i] & a[j]]) { cout << "No\n"; return 0; } } } cout << "Yes\n"; }