#include #include // #include #include #include #include #include #include using namespace std; // using namespace atcoder; using ll = long long; using ull = unsigned long long; #define REP(i, m, n) for (ll(i) = (ll)(m); i < (ll)(n); ++i) #define REP2(i, m, n) for (ll(i) = (ll)(n)-1; i >= (ll)(m); --i) #define rep(i, n) REP(i, 0, n) #define rep2(i, n) REP2(i, 0, n) #define drep(i, n) for (ll(i) = (ll)(n); i >= 0; i--) #define all(hoge) (hoge).begin(), (hoge).end() #define rall(hoge) (hoge).rbegin(), (hoge).rend() #define en '\n' // using Edge = pair; // using Graph = vector>; typedef vector vl; typedef vector> vvl; typedef vector>> vvvl; typedef vector vs; typedef vector> vvs; typedef pair P; constexpr long long INF = 1LL << 30; constexpr int INF_INT = 1 << 25; constexpr long long MOD = (ll)1e9 + 7; // constexpr long long MOD = 998244353LL; using ld = long double; static const ld pi = 3.141592653589793L; template inline void print(T x) { cout << x << '\n'; } template bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; } long long lcm(long long x, long long y) { return x / gcd(x, y) * y; } // ~~~~~~~~~~~~~~memo~~~~~~~~~~~~~~ // for (int i = 0; i < n; ++i) // cout << res << endl; // cout << res << '\n'; // int型の2次元配列(h×w要素の)の宣言 // vector> data(h, vector(w)); // rotate(s.begin(), s.begin() + 1, s.end()); // sort(all(a),greater()); // s.substr(0,2) 先頭から2文字切り出す // for (auto it = mp.rbegin();it != mp.rend(); ++it) vector > prime_factorize(long long N) { vector > res; for (long long a = 2; a * a <= N; ++a) { if (N % a != 0) continue; long long ex = 0; while (N % a == 0) { ++ex; N /= a; } res.push_back({a, ex}); } if (N != 1) res.push_back({N, 1}); return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); ll n,h; cin >> n >> h; vl a(n); rep(i,n) cin >> a[i]; auto pf = prime_factorize(h); ll sz = pf.size(); vl cnt(sz,0); rep(i,n) { ll j = 0; for (auto p:pf) { ll v = p.first; ll count = p.second; if (count == 0) continue; bool ff =false; while(a[i]%v == 0 && count > 0) { count--; a[i] /= v; } if (ff) { cnt[j] += count; } j++; } } bool f = true; rep(i,sz) { if (cnt[i] != 0) f = false; } if (f) { print("YES"); } else { print("NO"); } return 0; }