#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } inline double time() { return static_cast(chrono::duration_cast(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector x(m); for (int i = 0; i < m; ++i) { cin >> x[i]; x[i] *= 10000; } set> st[101]; vector> b(n); vector t(n); for (int i = 0; i < n; ++i) { vector a(m); for (int j = 0; j < m; ++j) { cin >> a[j]; } b[i] = a; cin >> t[i]; st[t[i]].insert(a); } vector target(m); for (int j = 0; j < n; ++j) { for (int ti = 1; ti <= 100; ++ti) { bool ok = true; for (int i = 0; i < m; ++i) { target[i] = x[i] - (100LL - ti) * t[j] * b[j][i]; if (target[i]%(100*ti)) { ok = false; break; } else { target[i] /= (100*ti); } } if (!ok) continue; if (st[ti].find(target) != st[ti].end() and target != b[j]) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; }