#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { int N, M; cin >> N >> M; vector E(1 << N, false); vector A(M); for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { char a; cin >> a; A[i] |= (a == '1') << j; } E[A[i]] = true; } bool ans = true; for (int i = 0; i < M; i++) { for (int j = 0; j < M; j++) { if (!E[A[i] | A[j]]) ans = false; if (!E[A[i] & A[j]]) ans = false; } } if (!E.front()) ans = false; if (!E.back()) ans = false; puts(ans ? "Yes" : "No"); }