#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const dynamic_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} template void chmin(T& a, T b){a = min(a, b);} template void chmax(T& a, T b){a = max(a, b);} int main(){ int n, m; cin >> n >> m; vector x(m); cin >> x; vector> c(n, vector(m)); vector t(n); rep(i, n){ cin >> c[i] >> t[i]; } map, vector> ma; rep(i, n){ vector tmp(m); rep(j, m) tmp[j] = c[i][j] * t[i]; ma[tmp].push_back(i); } rep(i, n){ if(t[i] == 100){ if(c[i] == x){ cout << "Yes\n"; return 0; } }else{ bool fail = false; vector tmp(m); rep(j, m) tmp[j] = 10000 * x[j] - 100 * t[i] * c[i][j]; rep(j, m){ if(tmp[j] % (100 - t[i]) != 0) fail = true; else tmp[j] /= 100 - t[i]; } if(fail) continue; if(ma.find(tmp) != ma.end()){ auto& v = ma[tmp]; for(int j : v){ if(i != j){ cout << "Yes\n"; return 0; } } } } } cout << "No\n"; return 0; }