#include #include #include using namespace std; int main() { int N, M; cin >> N >> M; vector> a(M, vector(N)); for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { cin >> a[i][j]; } } vector now(N); vector s(N + 2); s[0] = 0; s[N + 1] = 1100000000; for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { now[j] += a[i][j]; } for (int j = 0; j < N; j++) { s[j + 1] = s[j] + now[j]; } for (int j = 0; j <= N; j++) { auto itr = lower_bound(s.begin(), s.end(), 777 + s[j]); if (*itr == 777 + s[j]) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }