#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i struct Modint { long long val; constexpr Modint(long long v = 0) noexcept : val(v % MOD) { if (val < 0) val += MOD; } constexpr int mod() const { return MOD; } constexpr long long value() const { return val; } constexpr Modint operator - () const noexcept { return val ? MOD - val : 0; } constexpr Modint operator + (const Modint& r) const noexcept { return Modint(*this) += r; } constexpr Modint operator - (const Modint& r) const noexcept { return Modint(*this) -= r; } constexpr Modint operator * (const Modint& r) const noexcept { return Modint(*this) *= r; } constexpr Modint operator / (const Modint& r) const noexcept { return Modint(*this) /= r; } constexpr Modint& operator += (const Modint& r) noexcept { val += r.val; if (val >= MOD) val -= MOD; return *this; } constexpr Modint& operator -= (const Modint& r) noexcept { val -= r.val; if (val < 0) val += MOD; return *this; } constexpr Modint& operator *= (const Modint& r) noexcept { val = val * r.val % MOD; return *this; } constexpr Modint& operator /= (const Modint& r) noexcept { long long a = r.val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } val = val * u % MOD; if (val < 0) val += MOD; return *this; } constexpr bool operator == (const Modint& r) const noexcept { return this->val == r.val; } constexpr bool operator != (const Modint& r) const noexcept { return this->val != r.val; } friend constexpr istream& operator >> (istream& is, Modint& x) noexcept { is >> x.val; x.val %= MOD; if (x.val < 0) x.val += MOD; return is; } friend constexpr ostream& operator << (ostream& os, const Modint& x) noexcept { return os << x.val; } constexpr Modint pow(long long n) noexcept { if (n == 0) return 1; if (n < 0) return this->pow(-n).inv(); Modint ret = pow(n >> 1); ret *= ret; if (n & 1) ret *= *this; return ret; } constexpr Modint inv() noexcept { long long a = this->val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } return Modint(u); } }; // const int MOD1 = MOD7, MOD2 = MOD998, MOD3 = 1000000007; // using mint1 = Modint, mint2 = Modint, mint = Modint; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, m; cin >> n >> m; vector x(m); rep(i, m) { cin >> x[i]; x[i] *= 10000; } vector c(n, vector (m, 0LL)); vector t(n, 0LL); rep(i, n) { rep(j, m) cin >> c[i][j]; cin >> t[i]; } auto solve = [&](bool flag = 0) -> void { set> st; rep(i, n) { if(t[i] == 100) { vector v(m); rep(j, m) { v[j] = c[i][j] * 100 * t[i]; } if(v == x) { cout << "Yes" << endl; exit(0); } } else { bool ng = false; vector v(m); rep(j, m) { ll num = x[j] - c[i][j] * 100 * t[i]; // if(flag and i == n - 1) cout << num << " " << (ll(100) - t[i]) << endl; if(num % (ll(100) - t[i])) { ng = true; break; } num /= (ll(100) - t[i]); v[j] = num; // if(flag and i == n - 1) cout << v[j] << " "; } // if(flag and i == n - 1) cout < v(m); rep(j, m) { v[j] = t[i] * c[i][j]; } st.insert(v); } }; solve(); reverse(all(c)); reverse(all(t)); solve(1); cout << "No" << endl; return 0; }