#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #define rep(i,n) for(int i=0;i<(n);i++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define sz(x) ((int)(x).size()) #define pb push_back using ll = long long; using namespace std; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; ll H; cin >> H; vector A(N); rep(i,N) cin >> A[i]; rep(i,N){ A[i] = abs(A[i]); if(A[i]==0){ cout << "YES" << endl; return 0; } } multiset primes; ll tmp = H; for(ll i=2;i*i<=tmp; i++){ while(tmp%i==0){ primes.insert(i); tmp/=i; } if(tmp==1) break; } if(tmp!=1) primes.insert(tmp); rep(i,N){ multiset del; for(auto p:primes){ if(A[i]%p==0){ A[i]/=p; del.insert(p); } } for(auto d:del) primes.erase(primes.find(d)); } if(primes.empty()) cout << "YES" << endl; else cout << "NO" << endl; return 0; }