#include using namespace std; const double pi = 3.14159265358979; #define setup\ cin.tie(0);\ ios::sync_with_stdio(false);\ cout << setprecision(20) << fixed; #define int long long int #define db double #define P pair #define F first #define S second #define endl "\n" #define dtor(deg) (((deg)/360)*2*pi) #define rtod(rad) (((rad)/2/pi)*360) #define all(a) a.begin(),a.end() #define Srep(n) for(int i = 0; i < n; i++) #define Lrep(i,a,n) for(int i = a; i < n; i++) #define Brep1st(n) for(int bit = 0; bit < (1 << n); bit++) #define Brep2nd(n) Srep(n) if(bit >> i & 1) #define rep2d(n,m) Srep(n) Lrep(j,0,m) #define vi vector #define vvi vector #define vdb vector #define vb vector bool is_prime(int n){ if (n < 2) return 0; else if (n == 2) return 1; else if (n % 2 == 0) return 0; for(int i = 3; i * i <= n; i += 2) if(n % i == 0) return 0; return 1; } signed main(){ setup; int n, h; cin >> n >> h; if(is_prime(h)){ Srep(n){ int input; cin >> input; if(input == h){ cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; } vi divisor(h); for(int i = 2; i * i <= h; i++){ while(!(h % i)){ h /= i; divisor[i]++; } } Srep(n){ int input; cin >> input; for(int j = 2; j * j <= input; j++){ while(!(input % j)){ input /= j; divisor[j]--; } } } auto itr = max_element(all(divisor)); if(*itr <= 0) cout << "YES" << endl; else cout << "NO" << endl; }