#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace std; using namespace atcoder; typedef long long ll; using mint = modint998244353; int main() { int h, w; cin >> h >> w; vector x(w), t(h); rep(i, 0, w) cin >> x[i]; vector> c(h, vector(w)); map, int> ma; rep(i, 0, h) { rep(j, 0, w) cin >> c[i][j]; cin >> t[i]; c[i].push_back(t[i]); ma[c[i]]++; } vector none = {-1}; auto f = [&](int ind, ll tt) { vector ret(w); rep(j, 0, w) { ll q = 10000LL * x[j]; q -= (100LL - tt) * t[ind] * c[ind][j]; ll p = tt * 100; if (abs(q) % abs(p) != 0) return none; ret[j] = q / p; } ret.push_back(tt); return ret; }; rep(i, 0, h) { ma[c[i]]--; rep(j, 1, 101) { auto v = f(i, j); if (v == none) continue; if (ma[v] > 0) { cout << "Yes" << endl; return 0; } } ma[c[i]]++; } cout << "No" << endl; }