#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector X(M),T(N); vector> C(N); for(auto &x : X) cin >> x,x *= 10000; multiset> S; for(int i=0; i now(M); for(auto &n : now) cin >> n; int t; cin >> t; for(auto &n : now) n *= t; S.insert(now); C.at(i) = now; T.at(i) = t; } bool yes = false; for(int i=0; i goal = X; bool ok = true; int t = T.at(i); if(t == 100){ for(int k=0; k= 0){ if(goal.at(k)%(t)){ok = false; break;} goal.at(k) /= t; } else{ok = false; break;} } S.erase(S.find(C.at(i))); if(S.count(goal) && ok){yes = true; break;} S.insert(C.at(i)); } if(yes) cout << "Yes" << endl; else cout << "No" << endl; }