#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N,M; cin >> N >> M; vector> s(M + 1, vector(N + 1, 0)); rep(i,M)rep(j,N) cin >> s[i + 1][j + 1]; rep(i,M+1)rep(j,N) s[i][j + 1] += s[i][j]; rep(j,N+1)rep(i,M) s[i + 1][j] += s[i][j]; rep(i,M+1) { rep(j,N+1) { if(binary_search(s[i].begin() + j, s[i].end(), s[i][j] + 777)) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }