#include using namespace std; #include // #include // #include // #include // #include // #include // #include using namespace atcoder; // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") typedef long long int ll; typedef unsigned long long ull; typedef long double ld; typedef pair pll; typedef vector vll; typedef vector vvll; typedef vector vvvll; typedef vector vpll; typedef vector vvpll; typedef vector vb; typedef vector vvb; typedef vector vd; typedef vector vvd; typedef priority_queue > pqpll; typedef priority_queue > pqll; struct edge{ ll to, cost; edge(ll e_to,ll e_cost): to(e_to), cost(e_cost){} }; typedef vector> Graph; #define rep(i,a,n) for(ll i = a;i < n;i++) #define rrep(i,a,n) for(ll i = n-1; i >= a;i--) #define LINF (1LL << 60) #define INF (1 << 30) #define fs first #define sc second #define EPS (ld)1e-10 #define ALL(a) a.begin(), a.end() #define tcheck(a) if((clock() - start)/(ld)CLOCKS_PER_SEC >= a) break #define debug(s) cout << #s << endl #define debugval(x) cout << #x" = " << x << endl template ll sz(vector &pos){ return (ll)pos.size(); } template ll sz(priority_queue > &que) {return (ll)que.size(); } template ll sz(priority_queue, greater > &que) {return (ll)que.size(); } ll sz(string &s) {return (ll)s.size(); } template void chmin(T &a, T b) { if(a > b) a = b; } template void chmax(T &a, T b) { if(a < b) a = b; } // __int128_t gcd(__int128_t a, __int128_t b){ return ((!b) ? a : gcd(b,a%b)); } ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); } ll lcm(ll a,ll b){ return a / gcd(a,b) * b; } ll dx[4] = {0,-1,0,1},dy[4] = {-1,0,1,0}; // ll dx[8] = {0,-1,-1,-1,0,1,1,1},dy[8] = {-1,-1,0,1,1,1,0,-1}; inline bool isinside(ll i,ll n){ return (i < n && i >= 0); } class Fraction{ private: ll num,den; ll frac_gcd(ll _a,ll _b){ return ((!_b) ?_a :frac_gcd(_b, _a%_b)); } public: Fraction():num(0),den(1){} Fraction(ll _num, ll _den): num(_num), den(_den){ ll sign = 1; if(num < 0) sign *= -1, num *= -1; if(den < 0) sign *= -1, den *= -1; ll g = frac_gcd(num,den); num /= g; den /= g; num *= sign; } bool operator!() const{return !(num);} bool operator==(const Fraction &f) const{ return (this->num == f.num && this->den == f.den); } bool operator!=(const Fraction &f) const{ return !((*this) == f); } bool operator<(const Fraction &f) const{ if((*this) == f) return false; else if(this->den == 0) return false; else if(f.den == 0) return true; else return (this->num*f.den < f.num*this->den); } bool operator>(const Fraction &f) const{ if((*this) == f) return false; else if(this->den == 0) return true; else if(f.den == 0) return false; else return (this->num*f.den > f.num*this->den); } bool operator<=(const Fraction &f) const{ return ((*this) == f || (*this) < f);} bool operator>=(const Fraction &f) const{ return ((*this) == f || (*this) > f);} Fraction operator+() const{ return (*this); } Fraction operator-() const{ return Fraction(-this->num, this->den);} Fraction operator+(const Fraction &f) const{ assert(f.den != 0 && this->den != 0); return Fraction(this->num*f.den+f.num*this->den, this->den*f.den); } Fraction operator-(const Fraction &f) const{ assert(f.den != 0 && this->den != 0); return Fraction(this->num*f.den-f.num*this->den, this->den*f.den); } Fraction operator*(const Fraction &f) const{ assert(f.den != 0 && this->den != 0); return Fraction(this->num*f.num, this->den*f.den); } Fraction operator/(const Fraction &f) const{ assert(f.den != 0 && this->den != 0); return Fraction(this->num*f.den, this->den*f.num); } Fraction operator+(const ll &x) const{ assert(this->den != 0); return (*this)+Fraction(x,1); } Fraction operator-(const ll &x) const{ assert(this->den != 0); return (*this)-Fraction(x,1); } Fraction operator*(const ll &x) const{ assert(this->den != 0); return (*this)*Fraction(x,1); } Fraction operator/(const ll &x) const{ assert(this->den != 0 && x != 0); return (*this)*Fraction(1,x); } Fraction& operator+=(const Fraction &f) { return (*this) = (*this) + f; } Fraction& operator-=(const Fraction &f) { return (*this) = (*this) - f; } Fraction& operator*=(const Fraction &f) { return (*this) = (*this) * f; } Fraction& operator/=(const Fraction &f) { return (*this) = (*this) / f; } Fraction& operator+=(const ll &x) { return (*this) = (*this) + x; } Fraction& operator-=(const ll &x) { return (*this) = (*this) - x; } Fraction& operator*=(const ll &x) { return (*this) = (*this) * x; } Fraction& operator/=(const ll &x) { return (*this) = (*this) / x; } Fraction& operator++() { return (*this) += 1; } Fraction& operator--() { return (*this) -= 1; } Fraction& operator=(ll x) { return (*this) = Fraction(x,1);} friend ostream &operator<<(ostream &os, const Fraction &f){ return os << f.num << " / " << f.den; } friend istream &operator>>(istream &is, Fraction &f){ ll _n,_d; is >> _n >> _d; f = Fraction(_n,_d); return (is); } ll floor(){ assert(this->den != 0); return this->num / this->den; } ll ceil(){ assert(this->den != 0); return (this->num+this->den-1) / this->den; } ll getdenom(){ return this->den; } ll getnumer(){ return this->num; } }; int main(){ ll n,m; cin >> n >> m; vll x(10); rep(i,0,m) cin >> x[i]; vvll c(n, vll(10)); vll t(n); rep(i,0,n){ rep(j,0,m) cin >> c[i][j]; cin >> t[i]; } set> st; rep(i,0,n){ if(t[i] == 100){ if(c[i] == x){ cout << "Yes" << endl; return 0; } } else{ bool isok = true; array arr; rep(j,0,10){ isok &= (10000*x[j]-100*t[i]*c[i][j]) % (100-t[i]) == 0; if(!isok) break; arr[j] = (10000*x[j]-100*t[i]*c[i][j])/(100-t[i]); } if(isok) st.insert(arr); } } rep(i,0,n){ array arr; rep(j,0,10) arr[j] = t[i]*c[i][j]; if(st.count(arr) > 0){ cout << "Yes" << endl; return 0; } } cout << "No" << endl; }