#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve() { ll n, m; cin >> n >> m; vector a(m); vector used(1 << n, false); rep(i, m) { string s; cin >> s; ll b = 1; rep(j, n) { if (s[j] == '1') a[i] += b; b <<= 1; } used[a[i]] = true; } bool ok = used[0] && used[(1 << n) - 1]; rep(j, m) rep(i, j) ok &= used[a[i] & a[j]]; set now; now.insert(0); rep(i, m) if (ok && a[i] > 0) { for (auto iter = now.rbegin(); iter != now.rend(); iter++) { ll x = *iter | a[i]; ok &= used[x]; now.insert(x); } } cout << (ok ? "Yes" : "No") << '\n'; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }