#include using namespace std; using ll = long long; int pb(map &m, int x){ int t = x; for(ll i=2; i*i<=t; i++){ if(x % i == 0){ x /= i; m[i]++; } if(x == 1) break; } if(x != 1) m[x]++; } int main(){ int n,h; cin >> n >> h; map hm; pb(hm, h); map am; int t; for(int i=0; i> t; pb(am, t); } for(auto e : hm){ auto k = e.first; auto v = e.second; if(v > am[k]){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; }