#include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = int64_t; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max()/32*15+208; int main() { int n, m; cin >> n >> m; vector v(n); for (int i = 0; i < m; ++i) { int s = 0; map M; M[0]++; for (int j = 0; j < n; ++j) { int x; cin >> x; v[j] += x; s += v[j]; if(M.count(s-777)) { puts("YES"); return 0; } M[s]++; } } puts("NO"); return 0; }