#include<bits/stdc++.h> #define ll long long #define INF 1e9 usingnamespace std; int n, m; char a[2005][2005]; int cnt[2005]; // cnt[i] 表示有多少个开关可以打开第 i 盏灯 signedmain(){ ios :: sync_with_stdio(0); cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> a[i][j]; if (a[i][j] == '1') cnt[j]++; } } for (int i = 1; i <= n; i++) { bool flag = 0; for (int j = 1; j <= m; j++) { if (a[i][j] == '1') { if (cnt[j] == 1) flag = 1; // 这个开关是不可去掉的 } } if (!flag) { cout << "YES"; return0; } } cout << "NO"; return0; }