#include using namespace std; #ifdef LOCAL_ void debug_out() {cerr << endl;} template void debug_out(Head H,Tail... T){cerr << ' ' << H; debug_out(T...);} #define debug(...) cerr << 'L' << __LINE__ << " [" << #__VA_ARGS__ << "]:",debug_out(__VA_ARGS__) #define dump(x) cerr << 'L' << __LINE__ << " " << #x << " = " << (x) << endl; #else #define debug(...) (void(0)) #define dump(x) (void(0)) #endif #define rep(i,n) for (int i = 0; i < (int)(n); i ++) #define irep(i,n) for (int i = (int)(n) - 1;i >= 0;--i) using ll = long long; using PL = pair; using P = pair; constexpr int INF = 1000000000; constexpr long long HINF = 1000000000000000; constexpr long long MOD = 1000000007;// = 998244353; constexpr double EPS = 1e-4; constexpr double PI = 3.14159265358979; vector sieve(int n) { vector prime(n + 1,true); prime[0] = false; prime[1] = false; for (int i = 3; i * i <= n; i += 2) { if (prime[i]) { int j = 2; while (i * j <= n) { prime[i * j] = false; j ++; } } } vector ans = {2}; for (int i = 3; i < n + 1; i += 2) { if (prime[i]) ans.push_back(i); } return ans; } vector> factorization(long long N,vector& primes) { vector> ret; for (int p:primes) { int power = 0; while (N%p == 0) { power ++; N /= p; } if (power > 0) ret.emplace_back(p,power); } if (N > 1) ret.emplace_back(N,1); return ret; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll N,H; cin >> N >> H; vector A(N); rep(i,N) { cin >> A[i]; if (A[i] == 0) { cout << "YES" << '\n'; return 0; } } auto ps = sieve(100000); auto x = factorization(H,ps); for (ll a:A) { for (P &p:x) { while (p.first > 0 && a%p.first == 0) { p.second--; a /= p.first; } } } bool flag = true; for (P &p:x) { if (p.second > 0) flag = false; } cout << (flag ? "YES":"NO") << '\n'; return 0; }