#include using ll = long long; using std::cin; using std::cout; using std::endl; std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count()); template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } constexpr int inf = (int)1e9 + 7; constexpr long long INF = 1LL << 60; void solve() { int n, m; cin >> n >> m; std::vector X(m); for (int i = 0; i < m; i++) { cin >> X[i]; X[i] *= 10000; } std::vector C(n, std::vector(m)); std::vector T(n); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> C[i][j]; } cin >> T[i]; } for (int _ = 0; _ < 2; _++) { std::set> s; std::vector v(m); for (int i = 0; i < n; i++) { bool ok = true; for (int j = 0; j < m; j++) { v[j] = X[j] - T[i] * 100 * C[i][j]; if (v[j] % (100 - T[i]) != 0) { ok = false; break; } v[j] /= 100 - T[i]; } if (ok and s.count(v)) { cout << "Yes" << "\n"; return; } for (int j = 0; j < m; j++) { v[j] = T[i] * C[i][j]; } s.emplace(v); } std::reverse(T.begin(), T.end()); std::reverse(C.begin(), C.end()); } cout << "No" << "\n"; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int kkt = 1; // cin >> kkt; while (kkt--) { solve(); } }