#include #include #include void solve() { int n; std::cin >> n; std::vector xs(n, 0); int m; std::cin >> m; while (m--) { for (auto& x : xs) { int d; std::cin >> d; x += d; } int acc = 0; std::set s; s.insert(acc); for (auto x : xs) { acc += x; if (s.count(acc - 777)) { std::cout << "YES" << std::endl; return; } s.insert(acc); } } std::cout << "NO" << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }