#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); int n, m; cin >> n >> m; vector s; vector exist(1 << n, false); for (int i = 0; i < m; i++) { string a; cin >> a; int num = 0; for (int j = 0; j < n; j++) { if (a[j] == '1') { num += 1 << j; } } s.push_back(num); exist[num] = true; } vector dp(1 << n, false); dp[0] = true; for (int i = 0; i < m; i++) { for (int j = (1 << n) - 1; j >= 0; j--) { if (dp[j]) { dp[j | s[i]] = true; } } } if (!exist[(1 << n) - 1]) { cout << "No" << endl; return 0; } for (int i = 0; i < (1 << n); i++) { if (dp[i] && !exist[i]) { cout << "No" << endl; return 0; } } for (int i = 0; i < (1 << n); i++) { if (!exist[i]) { continue; } for (int j = i + 1; j < (1 << n); j++) { if (exist[j] && !exist[i & j]) { cout << "No" << endl; return 0; } } } cout << "Yes" << endl; }