#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace atcoder; using namespace std; typedef long long ll; int binaryToInt(string s) { int res = 0; for (int i = 0; i < s.size(); i++) { res = res * 2 + (s[i] - '0'); } return res; } int main() { int m, n; cin >> m >> n; vector s(n); vector a(n); set st; vector zero(m); rep(i, 0, n) { cin >> s[i]; rep(j, 0, m) { zero[j] += s[i][j] == '0'; } a[i] = binaryToInt(s[i]); st.insert(a[i]); } int allzero = 0; rep(i, 0, m) { if (zero[i] == n) { allzero++; } } m -= allzero; if (st.size() == (1 << m) && m != 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }