#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const dynamic_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, static_modint& a) {long long x; is >> x; a = x; return is;} template istream& operator>>(istream& is, dynamic_modint& a) {long long x; is >> x; a = x; return is;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} template ostream& operator<<(ostream& os, const set& se){for(T x : se) os << x << " "; os << "\n"; return os;} template ostream& operator<<(ostream& os, const unordered_set& se){for(T x : se) os << x << " "; os << "\n"; return os;} template ostream& operator<<(ostream& os, const atcoder::segtree& seg){int n = seg.max_right(0, [](S){return true;}); rep(i, n) os << seg.get(i) << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const atcoder::lazy_segtree& seg){int n = seg.max_right(0, [](S){return true;}); rep(i, n) os << seg.get(i) << (i == n - 1 ? "\n" : " "); return os;} template void chmin(T& a, T b){a = min(a, b);} template void chmax(T& a, T b){a = max(a, b);} int main(){ int n, m; cin >> n >> m; vector s(m); cin >> s; auto f = [&](string s){ int ans = 0; rep(i, n){ ans <<= 1; if(s[i] == '1') ans++; } return ans; }; vector memo(1 << n); rep(i, m){ memo[f(s[i])] = 1; } { string t; rep(k, n) t += '0'; if(memo[f(t)] == 1){ cout << "No\n"; return 0; } } { string t; rep(k, n) t += '1'; if(memo[f(t)] == 1){ cout << "No\n"; return 0; } } rep(i, m) rep(j, m){ { string t; rep(k, n){ if(s[i][k] == '1' and s[j][k] == '1') t += '1'; else t += '0'; } if(memo[f(t)] == 1){ cout << "No\n"; return 0; } } { string t; rep(k, n){ if(s[i][k] == '1' or s[j][k] == '1') t += '1'; else t += '0'; } if(memo[f(t)] == 1){ cout << "No\n"; return 0; } } } cout << "Yes\n"; return 0; }