#include <iostream> #include <algorithm> #include <vector> #include <set> using namespace std; int a[1001][1001]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> a[i + 1][j + 1]; a[i + 1][j + 1] += a[i][j + 1]; } } for (int i = 0; i < m; i++) { set<int> st; for (int j = 0; j < n; j++) { // s[j] - s[i] = 777 st.insert(a[i + 1][j]); a[i + 1][j + 1] += a[i + 1][j]; if (st.count(a[i + 1][j + 1] - 777)) { puts("YES"); return 0; } } } puts("NO"); }