#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <algorithm>
#include <unordered_map>
#define int                long long
#define pb                 push_back
#define pi                 pair<int,int>
#define vi                 vector<int>
#define all(v)             v.begin(),v.end()
#define MOD                1000000007
#define F                  first
#define S                  second
#define FOR(i,r)           for(int i=0;i<r;i++)
#define REP(i,l,r)         for(int i=l;i<r;i++)
#define RER(i,l,r)         for(int i=l;i>=r;i--)
#define print(v)           for(auto i : v)cout << i << ' ';
#define FASTIO             ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mem(arr,k)         memset(arr,k,sizeof(arr));
#define pii                acos(-1.0)
#define PI                 3.1415926535897932385
#define Sin(a)             sin((pi*a)/180)
#define test()             int x;cin >> x;while(x--){solve();}
#define test2()            int x;cin >> x;for(int i=1;i<=x;i++){cout << "Case #" << i << " : ";solve();}
#define watch(x)           cout << (#x) << " is " << (x) << endl
using namespace std;

/* Mathematical Functions */
int power(int x,int y);
bool isPrime(int n);
int modInv(int a,int b);
int gcdExtended(int a,int b,int *x,int* y);
int mpower(int a,int b,int p);

const int inf = (int)1e17;
const int N = (int)1e7+5;
class node{
public:
	int zero,one,zo,oz;
};
node tree[N];
int lazy[N];
string str;
void build(int ss,int se,int i){
	if(ss == se){
		tree[i].zero = tree[i].one = tree[i].zo = tree[i].oz = 0;
		if(str[ss] == '4'){
			tree[i].zero = 1;
		}
		else
			tree[i].one = 1;
		return;
	}
	int mid = (ss+se)/2;
	build(ss,mid,2*i);
	build(mid+1,se,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;

}
void update(int ss,int se,int l,int r,int i){

	if(lazy[i] != 0){
		if(lazy[i]){
			swap(tree[i].zo,tree[i].oz);
			swap(tree[i].one,tree[i].zero);
		}
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		lazy[i] = 0;
	}
	if(l > se || r < ss)
		return;
	if(l <= ss && r >= se){
		swap(tree[i].zo,tree[i].oz);
		swap(tree[i].one,tree[i].zero);
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		return;
	}
	int mid = (ss+se)/2;
	update(ss,mid,l,r,2*i);
	update(mid+1,se,l,r,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;
}
int32_t main(){

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
	FASTIO;
	int n,q;
	cin >> n >> q;
	cin >> str;
	build(0,n-1,1);
	REP(i,0,q){
		string upd;
		cin >> upd;
		if(upd == "switch"){
			int l,r;
			cin >> l >> r;
			l--;
			r--;
			update(0,n-1,l,r,1);
			/*for(int j=l;j<=r;j++){
				update(0,n-1,j,j,1);
			}*/
		}
		else{
			cout << max(tree[1].zero,max(tree[1].one,tree[1].zo)) << endl;
		}
	}
    return 0;

}
int modInv(int a, int m)
{
int x, y;
int g = gcdExtended(a, m, &x, &y);
int res = (x%m + m) % m;
return res;
}

int gcdExtended(int a, int b, int *x, int *y)
{
if (a == 0){
    *x = 0, *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b%a, a, &x1, &y1);
  *x = y1 - (b/a) * x1;
  *y = x1;
  return gcd;
}

int mpower(int x, int y, int p)
{
int res = 1;
x = x % p;
while(y > 0){
    if(y & 1) res = (res*x) % p;
      y = y>>1;
      x = (x*x) % p;
    }
    return res;
}
int power(int x, int y)
{
int res = 1;
while (y > 0){
    if (y & 1) res = res*x;
      y = y>>1;
      x = x*x;
    }
    return res;
}

bool isPrime(int n)
{
if (n <= 1)  return false;
  if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
      int p=sqrt(n);
      for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
          return false;
      return true;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <algorithm>
#include <unordered_map>
#define int                long long
#define pb                 push_back
#define pi                 pair<int,int>
#define vi                 vector<int>
#define all(v)             v.begin(),v.end()
#define MOD                1000000007
#define F                  first
#define S                  second
#define FOR(i,r)           for(int i=0;i<r;i++)
#define REP(i,l,r)         for(int i=l;i<r;i++)
#define RER(i,l,r)         for(int i=l;i>=r;i--)
#define print(v)           for(auto i : v)cout << i << ' ';
#define FASTIO             ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mem(arr,k)         memset(arr,k,sizeof(arr));
#define pii                acos(-1.0)
#define PI                 3.1415926535897932385
#define Sin(a)             sin((pi*a)/180)
#define test()             int x;cin >> x;while(x--){solve();}
#define test2()            int x;cin >> x;for(int i=1;i<=x;i++){cout << "Case #" << i << " : ";solve();}
#define watch(x)           cout << (#x) << " is " << (x) << endl
using namespace std;

/* Mathematical Functions */
int power(int x,int y);
bool isPrime(int n);
int modInv(int a,int b);
int gcdExtended(int a,int b,int *x,int* y);
int mpower(int a,int b,int p);

const int inf = (int)1e17;
const int N = (int)5e6+5;
class node{
public:
	int zero,one,zo,oz;
};
node tree[N];
int lazy[N];
string str;
void build(int ss,int se,int i){
	if(ss == se){
		tree[i].zero = tree[i].one = tree[i].zo = tree[i].oz = 0;
		if(str[ss] == '4'){
			tree[i].zero = 1;
		}
		else
			tree[i].one = 1;
		return;
	}
	int mid = (ss+se)/2;
	build(ss,mid,2*i);
	build(mid+1,se,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;

}
void update(int ss,int se,int l,int r,int i){

	if(lazy[i] != 0){
		if(lazy[i]){
			swap(tree[i].zo,tree[i].oz);
			swap(tree[i].one,tree[i].zero);
		}
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		lazy[i] = 0;
	}
	if(l > se || r < ss)
		return;
	if(l <= ss && r >= se){
		swap(tree[i].zo,tree[i].oz);
		swap(tree[i].one,tree[i].zero);
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		return;
	}
	int mid = (ss+se)/2;
	update(ss,mid,l,r,2*i);
	update(mid+1,se,l,r,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;
}
int32_t main(){

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
	FASTIO;
	int n,q;
	cin >> n >> q;
	cin >> str;
	build(0,n-1,1);
	REP(i,0,q){
		string upd;
		cin >> upd;
		if(upd == "switch"){
			int l,r;
			cin >> l >> r;
			l--;
			r--;
			update(0,n-1,l,r,1);
			/*for(int j=l;j<=r;j++){
				update(0,n-1,j,j,1);
			}*/
		}
		else{
			cout << max(tree[1].zero,max(tree[1].one,tree[1].zo)) << endl;
		}
	}
    return 0;

}
int modInv(int a, int m)
{
int x, y;
int g = gcdExtended(a, m, &x, &y);
int res = (x%m + m) % m;
return res;
}

int gcdExtended(int a, int b, int *x, int *y)
{
if (a == 0){
    *x = 0, *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b%a, a, &x1, &y1);
  *x = y1 - (b/a) * x1;
  *y = x1;
  return gcd;
}

int mpower(int x, int y, int p)
{
int res = 1;
x = x % p;
while(y > 0){
    if(y & 1) res = (res*x) % p;
      y = y>>1;
      x = (x*x) % p;
    }
    return res;
}
int power(int x, int y)
{
int res = 1;
while (y > 0){
    if (y & 1) res = res*x;
      y = y>>1;
      x = x*x;
    }
    return res;
}

bool isPrime(int n)
{
if (n <= 1)  return false;
  if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
      int p=sqrt(n);
      for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
          return false;
      return true;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <algorithm>
#include <unordered_map>
#define int                long long
#define pb                 push_back
#define pi                 pair<int,int>
#define vi                 vector<int>
#define all(v)             v.begin(),v.end()
#define MOD                1000000007
#define F                  first
#define S                  second
#define FOR(i,r)           for(int i=0;i<r;i++)
#define REP(i,l,r)         for(int i=l;i<r;i++)
#define RER(i,l,r)         for(int i=l;i>=r;i--)
#define print(v)           for(auto i : v)cout << i << ' ';
#define FASTIO             ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mem(arr,k)         memset(arr,k,sizeof(arr));
#define pii                acos(-1.0)
#define PI                 3.1415926535897932385
#define Sin(a)             sin((pi*a)/180)
#define test()             int x;cin >> x;while(x--){solve();}
#define test2()            int x;cin >> x;for(int i=1;i<=x;i++){cout << "Case #" << i << " : ";solve();}
#define watch(x)           cout << (#x) << " is " << (x) << endl
using namespace std;

/* Mathematical Functions */
int power(int x,int y);
bool isPrime(int n);
int modInv(int a,int b);
int gcdExtended(int a,int b,int *x,int* y);
int mpower(int a,int b,int p);

const int inf = (int)1e17;
const int N = (int)3e5+5;
class node{
public:
	int zero,one,zo,oz;
};
node tree[N];
int lazy[N];
string str;
void build(int ss,int se,int i){
	if(ss == se){
		tree[i].zero = tree[i].one = tree[i].zo = tree[i].oz = 0;
		if(str[ss] == '4'){
			tree[i].zero = 1;
		}
		else
			tree[i].one = 1;
		return;
	}
	int mid = (ss+se)/2;
	build(ss,mid,2*i);
	build(mid+1,se,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;

}
void update(int ss,int se,int l,int r,int i){

	if(lazy[i] != 0){
		if(lazy[i]){
			swap(tree[i].zo,tree[i].oz);
			swap(tree[i].one,tree[i].zero);
		}
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		lazy[i] = 0;
	}
	if(l > se || r < ss)
		return;
	if(l <= ss && r >= se){
		swap(tree[i].zo,tree[i].oz);
		swap(tree[i].one,tree[i].zero);
		if(ss != se){
			lazy[2*i] ^= 1;
			lazy[2*i+1] ^= 1;
		}
		return;
	}
	int mid = (ss+se)/2;
	update(ss,mid,l,r,2*i);
	update(mid+1,se,l,r,2*i+1);
	node left = tree[2*i];
	node right = tree[2*i+1];
	node temp;
	temp.zo = temp.oz = 0;
	temp.zero = left.zero+right.zero;
	temp.one = left.one + right.one;
	if(left.zero && right.one){
		temp.zo = left.zero + right.one;
	}
	if(right.zo){
		temp.zo = max(temp.zo,left.zero + right.zo);
	}
	if(left.zo){
		temp.zo = max(temp.zo,left.zo + right.one);
	}
	if(left.one && right.zero){
		temp.oz = left.one + right.zero;
	}
	if(left.oz){
		temp.oz = max(temp.oz,left.oz+right.zero);
	}
	if(right.oz){
		temp.oz = max(temp.oz,left.one+right.oz);
	}
	tree[i] = temp;
}
int32_t main(){

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
	FASTIO;
	int n,q;
	cin >> n >> q;
	cin >> str;
	build(0,n-1,1);
	REP(i,0,q){
		string upd;
		cin >> upd;
		if(upd == "switch"){
			int l,r;
			cin >> l >> r;
			l--;
			r--;
			update(0,n-1,l,r,1);
			/*for(int j=l;j<=r;j++){
				update(0,n-1,j,j,1);
			}*/
		}
		else{
			cout << max(tree[1].zero,max(tree[1].one,tree[1].zo)) << endl;
		}
	}
    return 0;

}
int modInv(int a, int m)
{
int x, y;
int g = gcdExtended(a, m, &x, &y);
int res = (x%m + m) % m;
return res;
}

int gcdExtended(int a, int b, int *x, int *y)
{
if (a == 0){
    *x = 0, *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b%a, a, &x1, &y1);
  *x = y1 - (b/a) * x1;
  *y = x1;
  return gcd;
}

int mpower(int x, int y, int p)
{
int res = 1;
x = x % p;
while(y > 0){
    if(y & 1) res = (res*x) % p;
      y = y>>1;
      x = (x*x) % p;
    }
    return res;
}
int power(int x, int y)
{
int res = 1;
while (y > 0){
    if (y & 1) res = res*x;
      y = y>>1;
      x = x*x;
    }
    return res;
}

bool isPrime(int n)
{
if (n <= 1)  return false;
  if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
      int p=sqrt(n);
      for(int i=5;i<=p;i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
          return false;
      return true;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
struct A {
	int prime_count, * prime_list, * mark;
	A(int _prime_count, int* _prime_list, int* _mark) {
		prime_count = _prime_count;
		prime_list = _prime_list;
		mark = _mark;
	}
};
//Sang so nguyen to eratosthenes
A init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list(maxCi + 1, true);
	int k = 0;
	int* prime_list = new int[prime_count];
	int* mark = new int[maxCi + 1];
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[k++] = i;
			mark[i] = k-1;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					mark[j] = k-1;
					prime_count--;
				}
			}
		}
	}
	return A(prime_count, prime_list, mark);
}
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	if (k == 1) return true;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0) {
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
//Phan tich cac ci ra thua so nguyen to
void find_prime_pow(int X, int* prime_list, int prime_list_size, int* prime_pow, int* mark) {
	while (X > 1) {
		int prime = prime_list[mark[X]];
		int pos = mark[X];
		int cnt = 0;
		while (X % prime == 0) {
			X /= prime;
			cnt++;
		}
		prime_pow[pos] = max(prime_pow[pos], cnt);
	}
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	A prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.prime_list;
	int prime_list_size = prime_list_and_size.prime_count;
	int* mark = prime_list_and_size.mark;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow, mark);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)) {
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
struct A {
	int prime_count, * prime_list, * mark;
	A(int _prime_count, int* _prime_list, int* _mark) {
		prime_count = _prime_count;
		prime_list = _prime_list;
		mark = _mark;
	}
};
A init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list(maxCi + 1, true);
	int k = 0;
	int* prime_list = new int[prime_count];
	int* mark = new int[prime_count+1];
	mark[0] = mark[1] = 1;
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[k++] = i;
			mark[i] = k-1;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					mark[j] = k-1;
					prime_count--;
				}
			}
		}
	}
	return A(prime_count, prime_list, mark);
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	LCM(C[i]) mod k = 0
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0) {
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
void find_prime_pow(int X, int* prime_list, int prime_list_size, int* prime_pow, int* mark) {
	while (X > 1) {
		int prime = prime_list[mark[X]];
		int pos = mark[X];
		int cnt = 0;
		while (X % prime == 0) {
			X /= prime;
			cnt++;
		}
		prime_pow[pos] = max(prime_pow[pos], cnt);
	}
	// if (X == 1) return prime_pow;
	// int max_pow;
	// for (int i = 0; i < prime_list_size; i++)
	// {
	// 	max_pow = 0;
	// 	while (X % prime_list[i] == 0){
	// 		max_pow += 1;
	// 		X /= prime_list[i];
	// 	}
	// 	prime_pow[i] = max(prime_pow[i], max_pow);
	// }
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	A prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.prime_list;
	int prime_list_size = prime_list_and_size.prime_count;
	int* mark = prime_list_and_size.mark;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow, mark);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)) {
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
struct A {
	int prime_count, * prime_list, * mark;
	A(int _prime_count, int* _prime_list, int* _mark) {
		prime_count = _prime_count;
		prime_list = _prime_list;
		mark = _mark;
	}
};
//Sang so nguyen to eratosthenes
A init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list(maxCi + 1, true);
	int k = 0;
	int* prime_list = new int[prime_count];
	int* mark = new int[maxCi + 1];
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[k++] = i;
			mark[i] = k-1;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					mark[j] = k-1;
					prime_count--;
				}
			}
		}
	}
	return A(prime_count, prime_list, mark);
}
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	if (k == 1) return true;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0) {
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
//Phan tich cac ci ra thua so nguyen to
void find_prime_pow(int X, int* prime_list, int prime_list_size, int* prime_pow, int* mark) {
	while (X > 1) {
		int prime = prime_list[mark[X]];
		int pos = mark[X];
		int cnt = 0;
		while (X % prime == 0) {
			X /= prime;
			cnt++;
		}
		prime_pow[pos] = max(prime_pow[pos], cnt);
	}
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	A prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.prime_list;
	int prime_list_size = prime_list_and_size.prime_count;
	int* mark = prime_list_and_size.mark;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow, mark);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)) {
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
pair<int*, int> init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list (maxCi+1, true);
	int j = 0;
	int* prime_list = new int[prime_count];
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[j++] = i;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					prime_count--;
				}
			}
		}
	}
	return {prime_list, prime_count };
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	LCM(C[i]) mod k = 0
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0){
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
int *find_prime_pow(int X, int *prime_list, int prime_list_size, int* prime_pow){
	if (X == 1) return prime_pow;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (X % prime_list[i] == 0){
			max_pow += 1;
			X /= prime_list[i];
		}
		prime_pow[i] = max(prime_pow[i], max_pow);
	}
	return prime_pow;
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	pair<int*, int> prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.first;
	int prime_list_size = prime_list_and_size.second;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)){
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k, a[1000006]; //input
int MAXA=0;
int P[80005], d[1000006], np = 0;
int pf[80005];

void getInput(){
  cin >> n >> k;
  MAXA = k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    MAXA = max(MAXA, a[i]);
  }
}

void initEra() {
  for (int i = 2; i <= MAXA; i++) {
    if (d[i] == 0) {
      P[++np] = i;
      for (int j = 1; j * i <= MAXA; j++) d[i * j] = np;
    }
  }
}

void primeFac(int x) {
  while (x > 1) {
    int prime = P[d[x]];
    int pos = d[x];
    int cnt = 0;

    while (x % prime == 0) {
      cnt++;
      x = x / prime;
    }
    pf[pos] = max(pf[pos], cnt);
  }
}

void primeFacA(){
  for (int i = 1; i <= n; i++) {
    primeFac(a[i]);
  }
}

void solve(){
  initEra();
  primeFacA();
  bool kq = true;

  int flags = 1;
  while (k > 1) {
    int prime = P[d[k]];
    int pos = d[k];

    while (k % prime == 0) {
      pf[pos]--;
      if(pf[pos] < 0) {
        kq = false;
        flags = 0;
        break;
      }
      k = k / prime;
    }
    if(flags == 0) break;
  }

  if(kq == true) cout<<"Yes\n";
  else cout<<"No\n";
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie();

  getInput();
  solve();

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
pair<int*, int> init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	int* number_list = new int[maxCi + 1];
	for (int i = 2; i <= maxCi; i++) {
		number_list[i] = i;
	}
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i] > 0) {
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j] > 0) {
					number_list[j] = -1;
					prime_count--;
				}
			}
		}
	}
	int j = 0;
	int* prime_list = new int[prime_count];
	for (int i = 2; i <= maxCi; i++)
	{
		if (number_list[i] > 0)
		{
			prime_list[j++] = number_list[i];
		}
	}
	return { prime_list, prime_count };
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	Tinh BCNN cua day so C[i], i = [1:n]
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0){
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
	}
	if (k == 1)  return true;
	else return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
int *find_prime_pow(int X, int *prime_list, int prime_list_size, int* prime_pow){
	if (X == 1) return prime_pow;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (X % prime_list[i] == 0){
			max_pow += 1;
			X /= prime_list[i];
		}
		prime_pow[i] = max(prime_pow[i], max_pow);
	}
	return prime_pow;
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	pair<int*, int> prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.first;
	int prime_list_size = prime_list_and_size.second;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)){
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
struct A {
	int prime_count, * prime_list, * mark;
	A(int _prime_count, int* _prime_list, int* _mark) {
		prime_count = _prime_count;
		prime_list = _prime_list;
		mark = _mark;
	}
};
A init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list(maxCi + 1, true);
	int k = 0;
	int* prime_list = new int[prime_count];
	int* mark = new int[maxCi + 1];
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[k++] = i;
			mark[i] = k-1;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					mark[j] = k-1;
					prime_count--;
				}
			}
		}
	}
	return A(prime_count, prime_list, mark);
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	LCM(C[i]) mod k = 0
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	if (k == 1) return true;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0) {
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
void find_prime_pow(int X, int* prime_list, int prime_list_size, int* prime_pow, int* mark) {
	while (X > 1) {
		int prime = prime_list[mark[X]];
		int pos = mark[X];
		int cnt = 0;
		while (X % prime == 0) {
			X /= prime;
			cnt++;
		}
		prime_pow[pos] = max(prime_pow[pos], cnt);
	}
	// if (X == 1) return prime_pow;
	// int max_pow;
	// for (int i = 0; i < prime_list_size; i++)
	// {
	// 	max_pow = 0;
	// 	while (X % prime_list[i] == 0){
	// 		max_pow += 1;
	// 		X /= prime_list[i];
	// 	}
	// 	prime_pow[i] = max(prime_pow[i], max_pow);
	// }
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	A prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.prime_list;
	int prime_list_size = prime_list_and_size.prime_count;
	int* mark = prime_list_and_size.mark;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow, mark);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)) {
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
pair<int*, int> init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	bool* number_list = new bool[maxCi + 1];
	int j = 0;
	for (int i = 2; i <= maxCi; i++) {
		number_list[i] = true;
	}
	int* prime_list = new int[prime_count];
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[j++] = i;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					prime_count--;
				}
			}
		}
	}
	free(number_list);
	return {prime_list, prime_count };
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	LCM(C[i]) mod k = 0
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0){
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
int *find_prime_pow(int X, int *prime_list, int prime_list_size, int* prime_pow){
	if (X == 1) return prime_pow;
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (X % prime_list[i] == 0){
			max_pow += 1;
			X /= prime_list[i];
		}
		prime_pow[i] = max(prime_pow[i], max_pow);
	}
	return prime_pow;
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	pair<int*, int> prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.first;
	int prime_list_size = prime_list_and_size.second;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)){
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
	@author lehuy 19/09/2019
*/
/*
	Sinh day so nguyen to <= max Ci
*/
struct A {
	int prime_count, * prime_list, * mark;
	A(int _prime_count, int* _prime_list, int* _mark) {
		prime_count = _prime_count;
		prime_list = _prime_list;
		mark = _mark;
	}
};
A init_prime_list(int maxCi) {
	int prime_count = maxCi - 1;
	vector<bool> number_list(maxCi + 1, true);
	int k = 0;
	int* prime_list = new int[prime_count];
	int* mark = new int[prime_count];
	mark[0] = mark[1] = 1;
	for (int i = 2; i <= maxCi; i++) {
		if (number_list[i]) {
			prime_list[k++] = i;
			mark[i] = k-1;
			for (int j = 2 * i; j <= maxCi; j += i) {
				if (number_list[j]) {
					number_list[j] = false;
					mark[j] = k-1;
					prime_count--;
				}
			}
		}
	}
	return A(prime_count, prime_list, mark);
}
/*
	Tinh UCLN cua a va b
*/
long long gcd(long long a, long long b) {
	if (a == 0) return b;
	return gcd(b, a % b);
}
/*
	Tinh nghich dao cua a theo m
*/
long long extend_euclid(int a, int m) {
	return 0;
}
/*
	LCM(C[i]) mod k = 0
*/
bool solve(int k, int* prime_list, int* prime_pow, int prime_list_size) {
	int max_pow;
	for (int i = 0; i < prime_list_size; i++)
	{
		max_pow = 0;
		while (k % prime_list[i] == 0) {
			k /= prime_list[i];
			max_pow++;
		}
		if (max_pow > prime_pow[i])
			return false;
		if (k == 1) return true;
	}
	return false;
}
void printArray(int* array, int n) {
	for (int i = 0; i < n; i++)
	{
		printf("%4d ", array[i]);
	}
	printf("\n");
}
void find_prime_pow(int X, int* prime_list, int prime_list_size, int* prime_pow, int* mark) {
	while (X > 1) {
		int prime = prime_list[mark[X]];
		int pos = mark[X];
		int cnt = 0;
		while (X % prime == 0) {
			X /= prime;
			cnt++;
		}
		prime_pow[pos] = max(prime_pow[pos], cnt);
	}
	// if (X == 1) return prime_pow;
	// int max_pow;
	// for (int i = 0; i < prime_list_size; i++)
	// {
	// 	max_pow = 0;
	// 	while (X % prime_list[i] == 0){
	// 		max_pow += 1;
	// 		X /= prime_list[i];
	// 	}
	// 	prime_pow[i] = max(prime_pow[i], max_pow);
	// }
}
int main() {
	int k, n, temp, maxCi = 0;
	scanf("%d", &n);
	scanf("%d", &k);
	int* C = new int[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &temp);
		C[i] = temp;
		if (temp > maxCi) maxCi = temp;
	}
	A prime_list_and_size = init_prime_list(maxCi);
	int* prime_list = prime_list_and_size.prime_list;
	int prime_list_size = prime_list_and_size.prime_count;
	int* mark = prime_list_and_size.mark;
	int* prime_pow = new int[prime_list_size];
	for (int i = 0; i < prime_list_size; i++)
	{
		prime_pow[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		find_prime_pow(C[i], prime_list, prime_list_size, prime_pow, mark);
	}
	if (solve(k, prime_list, prime_pow, prime_list_size)) {
		printf("yes");
	}
	else printf("no");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g;
    cin >> n >> k;
    int x = k;
    multiset<int> s;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            s.insert(i);
        }
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i];
        multiset<int>::iterator it = s.begin();
        for (; it != s.end();) {
            if (c[i] % (*it) == 0) {
                c[i] /= (*it);
                s.erase(it++);
            } else
                it++;
        }
    }

    cout << (s.size() == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g = 0;
    cin >> n >> k;
    int x = k;
    multiset<int> s;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            s.insert(i);
        }
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i];
        g = gcd(g, c[i]);
    }
    for (int i = 1; i < n; i++) {
        c[i] /= g;
    }
    long long tmp = 1;
    for (int i = 0; i < n; i++) {
        tmp = c[i];
        multiset<int>::iterator it = s.begin();
        for (; it != s.end();) {
            if (tmp % (*it) == 0) {
                tmp /= (*it);
                s.erase(it++);
            } else
                it++;
        }
    }

    cout << (s.size() == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g = 0;
    cin >> n >> k;
    int x = k;
    multiset<int> s;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            s.insert(i);
        }
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i];
        g = gcd(g, c[i]);
    }
    for (int i = 1; i < n; i++) {
        c[i] /= g;
    }
    long long tmp = 1;
    for (int i = 0; i < n; i++) {
        g = gcd(tmp, c[i]);
        tmp /= g;
        tmp *= c[i];

        multiset<int>::iterator it = s.begin();
        for (; it != s.end();) {
            if (tmp % (*it) == 0) {
                tmp /= (*it);
                s.erase(it++);
            } else
                it++;
        }
    }

    cout << (s.size() == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g;
    cin >> n >> k >> g;
    bool yes = false;
    for (int i = 1; i < n; i++) {
        long long tmp;
        cin >> tmp;
        if (yes)
            continue;
        long long p = g;
        g = gcd(g, tmp);
        p /= g;
        p *= tmp;
        if (p >= k) {
            yes = true;
        }

    }
    cout << (yes ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g;
    cin >> n >> k >> g;
    bool yes = false;
    for (int i = 1; i < n; i++) {
        long long tmp;
        cin >> tmp;
        if (yes)
            continue;
        long long p = g;
        g = gcd(g, tmp);
        p /= g;
        p *= tmp;
        if (p > k) {
            yes = true;
        }

    }
    cout << (yes ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g = 0;
    cin >> n >> k;
    int x = k;
    map<int, int> mp;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            mp[i]++;
        }
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for (int i = 0; i < n; i++) {
        map<int, int>::iterator it = mp.begin();
        for (; it != mp.end();) {
            int cnt = 0;
            while (c[i] % (*it).first == 0) {
                c[i] /= (*it).first;
                cnt++;
            }
            if (cnt >= (*it).second) {
                mp.erase(it++);
            } else
                it++;
        }

    }

    cout << (mp.size() == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, k;

int c[1000005];

long long gcd(long long x, long long y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long g = 0;
    cin >> n >> k;
    int x = k;
    multiset<int> s;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            s.insert(i);
        }
    }
    for (int i = 0; i < n; i++) {
        cin >> c[i];
        g = gcd(g, c[i]);
    }
    x = g;
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) {
            x /= i;
            s.insert(i);
        }
    }
    for (int i = 0; i < n; i++) {

        multiset<int>::iterator it = s.begin();
        for (; it != s.end();) {
            if (c[i] % (*it) == 0) {
                c[i] /= (*it);
                s.erase(it++);
            } else
                it++;
        }
    }

    cout << (s.size() == 0 ? "YES" : "NO") << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int main(){
	int n, k, temp, tempgcd;
	cin >> n >> k;
	rep(a, 0, n){
		cin >> temp;
		tempgcd = gcd(temp, k);
		k /= tempgcd;
	}

	if (k == 1){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int main(){
	ll n, k, temp;
	ll maxlcm;
	cin >> n >> k;
	maxlcm = 1;
	rep(a, 0, n){
		cin >> temp;
		maxlcm = lcm(temp, maxlcm);
	}

	k /= gcd(maxlcm, k);

	if (k == 1){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int main(){
	ll n, k, temp;
	ll maxlcm;
	cin >> n >> k;
	maxlcm = 1;
	rep(a, 0, n){
		cin >> temp;
		maxlcm = lcm(temp, maxlcm);
		maxlcm = gcd(k, maxlcm);
	}

	k /= gcd(maxlcm, k);

	if (k == 1){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int main(){
	ll n, k, temp;
	ll maxlcm;
	cin >> n >> k;
	maxlcm = 1;
	rep(a, 0, n){
		cin >> temp;
		maxlcm = lcm(temp, maxlcm);
		maxlcm = gcd(k, maxlcm);

		if(maxlcm == k){
			break;
		}
	}

	if (k == maxlcm){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int isThere[1000001];
int main(){

    ios::sync_with_stdio(0);
    cin.tie(0);

	memset(isThere, true, sizeof(isThere));
	ll n, k, temp;
	ll maxlcm;
	cin >> n >> k;
	maxlcm = 1;
	rep(a, 0, n){
		cin >> temp;
		if(isThere[temp]){
			isThere[temp] = false;
			if(gcd(k, temp) != 1){
			    maxlcm = lcm(temp, maxlcm);
			    maxlcm = gcd(k, maxlcm);
		    }

			if(maxlcm == k){
			break;
			}
		}
	}

	if (k == maxlcm){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define rep(i, a, b) for (size_t i = a; i < (size_t)b; i++)
#define gcd __gcd
#define lcm(a, b) a/gcd(a, b)*b

int isThere[1000001];
int main(){
	memset(isThere, true, sizeof(isThere));
	ll n, k, temp;
	ll maxlcm;
	cin >> n >> k;
	maxlcm = 1;
	rep(a, 0, n){
		cin >> temp;
		if(isThere[temp]){
			isThere[temp] = false;
			maxlcm = lcm(temp, maxlcm);
			maxlcm = gcd(k, maxlcm);

			if(maxlcm == k){
			break;
			}
		}
	}

	if (k == maxlcm){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long ll;
const int maxn = 1000010;
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a % b);
}
ll c[maxn];
int main(){
	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	for(int i = 1; i <= n; i++){
		scanf("%lld", &c[i]);
	}
	ll tmp = c[1];
	tmp %= k;
	for(int i = 2; i <= n; i++){
		tmp = (tmp / gcd(tmp, c[i]) * c[i]) % k;
		if(tmp == 0){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long ll;
const int maxn = 1000010;
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a % b);
}
ll c[maxn];
int main(){
	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	scanf("%lld", &c[1]);
	ll tmp = c[1];
	ll lcm = 1;
	for(int i = 2; i <= n; i++){
		scanf("%lld", &c[i]);
		tmp = gcd(tmp, c[i]);
	}
	for(int i = 1; i <= n; i++){
		lcm *= c[i] / tmp;
		if(lcm % k == 0){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long ll;
const int maxn = 1000010;
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a % b);
}
ll c[maxn];
int main(){
	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	for(int i = 1; i <= n; i++){
		scanf("%lld", &c[i]);
	}
	ll tmp = c[1];
	tmp %= k;
	if(tmp == 0){
		puts("Yes");
		return 0;
	}
	for(int i = 2; i <= n; i++){
		tmp = (tmp / gcd(tmp, c[i]) * c[i]) % k;//
		if(tmp == 0){//
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long ll;
const int maxn = 1000010;
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a % b);
}
ll c[maxn];
int main(){
	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	scanf("%lld", &c[1]);
	ll tmp = c[1];
	for(int i = 2; i <= n; i++){
		scanf("%lld", &c[i]);
	}
	for(int i = 1; i <= n; i++){
		if(i >= 2){
			tmp = gcd(tmp, c[i]);
			c[i] /= tmp;
		}
		k /= gcd(k, c[i]);
		if(k == 1){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long ll;
const int maxn = 1000010;
ll gcd(ll a, ll b){
	if(b == 0) return a;
	return gcd(b, a % b);
}
ll c[maxn];
int main(){
	int n;
	ll k;
	scanf("%d%lld", &n, &k);
	for(int i = 1; i <= n; i++){
		scanf("%lld", &c[i]);
	}
	for(int i = 1; i <= n; i++){
		k /= gcd(k, c[i]);
		if(k == 1){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, k, c, a = 1;
    cin >> n >> k;
    while (n--)
    {
        cin >> c;
        a = (a*c)%k;
    }
    cout << (a ? "No\n" : "Yes\n");
}


#include <iostream>
#include <set>

using namespace std;

using ullint = unsigned long long int;

ullint gcd(ullint a, ullint b)
{
    return (b ? gcd(b, a%b) : a);
}

int main()
{
    ullint n, k, c, a = 1;
    cin >> n >> k;
    while (n--)
    {
        cin >> c;
        a = ((a*c)/gcd(a, c)) % k;
    }
    cout << (a ? "No\n" : "Yes\n");
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    int j = 0, cnt = 0;
    while (k)
    {
        if (lp[k] != j)
        {
            kPF[j] = max(cnt, kPF[j]);
            cnt = 1;
            j = lp[k];
        }
        else
            ++cnt;
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        scanf("%d", &c);
        if (c == 1)
            continue;
        factorize(c, lcm, lp, pr);
    }
    if (k != 1)
    {
        for (int i = 0, sz = pr.size(); i < sz; ++i)
            flag = flag && lcm[i] >= kPF[i];
    }
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>
#include <vector>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    int j = 0, cnt = 0;
    while (k)
    {
        if (lp[k] != j)
        {
            kPF[j] += cnt;
            cnt = 1;
            j = lp[k];
        }
        else
            ++cnt;
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        cin >> c;
        if (c == 1)
            continue;
        factorize(c, lcm, lp, pr);
    }
    if (k != 1)
    {
        for (int i = 0, sz = pr.size(); i < sz; ++i)
            flag = flag && lcm[i] >= kPF[i];
    }
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>
#include <vector>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    int j = 0, cnt = 0;
    while (k)
    {
        if (lp[k] != j)
        {
            kPF[j] += cnt;
            cnt = 1;
            j = lp[k];
        }
        else
            ++cnt;
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    lp[1] = 0;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        cin >> c;
        factorize(c, lcm, lp, pr);
    }
    for (int i = 0, sz = pr.size(); i < sz; ++i)
        flag = flag && lcm[i] >= kPF[i];
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>
#include <vector>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    int j = 0, cnt = 0;
    while (k > 1)
    {
        if (lp[k] != j)
        {
            kPF[j] += cnt;
            cnt = 1;
            j = lp[k];
        }
        else
            ++cnt;
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        cin >> c;
        factorize(c, lcm, lp, pr);
    }
    for (int i = 0, sz = pr.size(); i < sz; ++i)
        flag = flag && lcm[i] >= kPF[i];
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>
#include <vector>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    int j = 0, cnt = 0;
    while (k)
    {
        if (lp[k] != j)
        {
            kPF[j] = max(cnt, kPF[j]);
            cnt = 1;
            j = lp[k];
        }
        else
            ++cnt;
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        cin >> c;
        if (c == 1)
            continue;
        factorize(c, lcm, lp, pr);
    }
    if (k != 1)
    {
        for (int i = 0, sz = pr.size(); i < sz; ++i)
            flag = flag && lcm[i] >= kPF[i];
    }
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>

using namespace std;

int main()
{
    unsigned long long int n, k, c, a = 1;
    cin >> n >> k;
    while (n--)
    {
        cin >> c;
        a = (a*c)%k;
    }
    cout << (a ? "No\n" : "Yes\n");
}


#include <iostream>
#include <vector>

using namespace std;

void factorize(int k, vector<int> &kPF, vector<int> &lp, vector<int> &pr)
{
    while (k > 1)
    {
        ++kPF[lp[k]];
        k /= pr[lp[k]];
    }
}

int main()
{
    const int MAXC = 1000010;
    vector<int> lp(MAXC, -1), pr;
    for (int i = 2, m = -1; i < MAXC; ++i)
    {
        if (lp[i] == -1)
        {
            pr.push_back(i);
            lp[i] = ++m;
        }
        for (int j = 0, sz = pr.size(); j < sz && j <= lp[i] && i*pr[j] < MAXC; ++j)
            lp[i*pr[j]] = j;
    }
    int n, k, c;
    bool flag = true;
    cin >> n >> k;
    vector<int> kPF(pr.size()), lcm(pr.size());
    factorize(k, kPF, lp, pr);
    while (n--)
    {
        cin >> c;
        vector<int> cPF(pr.size());
        factorize(c, cPF, lp, pr);
        for (int i = 0, sz = pr.size(); i < sz; ++i)
            lcm[i] = max(lcm[i], cPF[i]);
    }
    for (int i = 0, sz = pr.size(); i < sz; ++i)
        flag = flag && lcm[i] >= kPF[i];
    cout << (flag ? "Yes\n" : "No\n");
}


#include <iostream>
#include <set>

using namespace std;

using ullint = unsigned long long int;

int main()
{
    ullint n, k, c, a = 1;
    set<ullint> s;
    cin >> n >> k;
    while (n--)
    {
        cin >> c;
        s.insert(c);
    }
    for (set<ullint>::const_iterator itr = s.begin(); itr != s.end(); ++itr)
        a = (a*(*itr)) % k;
    cout << (a ? "No\n" : "Yes\n");
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1;
int n, k, cur;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    int g = __gcd(lcm, cur);
    lcm *= cur / g;
    lcm = __gcd(int(lcm), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1;
int n, k, cur;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    int g = __gcd((int)lcm, cur);
    lcm *= cur / g;
    lcm = __gcd(int(lcm), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int const N = 1e6 + 10;
int n, k, c;
int gcd(int a, int b) {
  if (a == 0) return b;
  else return gcd(b % a, a);
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> c;
    int g = gcd(k, c);
    if (k % g == 0)
      k /= g;
  }
  cout << (k == 1 ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm;
int n, k, cur;
ll gcd(ll a, ll b) {
  if (a == 0) return b;
  else return gcd(b % a, a);
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    if (i) {
      int g = gcd(lcm, cur);
      lcm *= cur / g;
      lcm = gcd(lcm, k);
    }
    else
      lcm = cur;
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1, cur, k;
int n;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    ll g = __gcd(lcm, cur);
    lcm *= cur / g;
    lcm = __gcd(lcm, k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define int long long
const int N = 0, mod = 0;

int gcd(int x, int y) { return __gcd(x, y); }
long long lcm(int x, int y) { return x * 1ll * y / gcd(x, y); }

int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, k;
    cin >> n >> k;
    int cur = 1;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        cur = gcd(k, lcm(cur, x));
    }
    if (cur == k) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1, cur, k;
int n;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    lcm = __gcd(lcm * cur / __gcd(lcm, cur), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm;
int n, k, cur;
ll gcd(ll a, ll b) {
  if (a == 0) return b;
  else return gcd(b % a, a);
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    if (i) {
      int g = gcd(lcm, cur);
      lcm *= cur / g;
      lcm = gcd(lcm, k);
    }
    else
      lcm = cur;
  }
  cout << (lcm % k == 0 ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1;
int n, k, cur;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    int g = __gcd(lcm, cur);
    lcm *= cur / g;
    lcm = __gcd(lcm, k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1, cur, k;
int n;
int main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    lcm = __gcd(lcm * cur / __gcd(lcm, cur), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1, cur, k;
int n;
int main() {
  //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    lcm = __gcd(lcm * cur / __gcd(lcm, cur), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;
int const N = 1e6 + 10;
ll lcm = 1, cur, k;
int n;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &cur);
    lcm = __gcd(lcm * cur / __gcd(lcm, cur), k);
  }
  cout << (lcm == k ? "Yes": "No") << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
  //debug("sz = %d\n", sz);
}

int n, k;
vi d;
int sol[N];
ll v[N];

inline bool solve() {
  for(int i = 1; i <= n; ++i) {
    sol[v[i]] = 1;
    if(v[i] == k) return true;
  }
  for(int i = 2; i <= k; ++i) {
    if(sol[i] == 0) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N], marc[N];
int p[N], sz;
int n, k;
vi d;
int sol[N];
ll v[N];

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      int vem = sol[i];
      for(int j = 1; j * i < N; ++j) {
        is[i * j] = i;
        marc[i * j] |= vem;
      }
    }
  }
}

inline bool solve() {
  for(int i = 1; i <= n; ++i) sol[v[i]] = 1;
  crivo();
  for(int i = 2; i <= k; ++i) {
    if(marc[i] == 0) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
vi d;
int sol[N];
ll v[N];
ll marc[N];

inline bool solve() {
  for(int i = 0; i < sz; ++i) if(k % p[i] == 0) d.pb(p[i]);
  for(int i = 1; i <= n; ++i) {
    if(v[i] >= k) return true;
    for(int j = 1; j * v[i] <= k; ++j) {
      marc[v[i] * j] = 1;
    }
    //debug("\n");
  }
  for(int i = 2; i <= k; ++i) if(marc[i] == 0) return false;
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
vi d;
int sol[N];
ll v[N];
ll marc[N];

inline bool solve() {
  for(int i = 0; i < sz; ++i) if(k % p[i] == 0) d.pb(p[i]);
  for(int i = 1; i <= n; ++i) {
    if(v[i] == k) return true;
    for(int j = 1; j * v[i] <= k; ++j) {
      marc[v[i] * j] = 1;
    }
    //debug("\n");
  }
  for(int i = 2; i <= k; ++i) if(marc[i] == 0) return false;
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
  //debug("sz = %d\n", sz);
}

int n, k;
vi d;
int sol[N];
ll v[N];

inline bool solve() {
  crivo();
  for(int i = 0; i < sz; ++i) {
    if(k % p[i] == 0) d.pb(p[i]);
  }
  for(int i = 1; i <= n; ++i) {
    sol[v[i]] = 1;
  }
  for(int i = 0; i < d.size(); ++i) {
    if(sol[d[i]] == 0) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
vi d;
int sol[N];
ll v[N];

inline bool solve() {
  crivo();
  for(int i = 0; i < sz; ++i) if(k % p[i] == 0) d.pb(p[i]);
  for(int i = 1; i <= n; ++i) {
    sol[v[i]] = 1;
  }
  for(int i = 0; i < d.size(); ++i) {
    if(sol[d[i]] == 0) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
int p1[N], p2[N];
int cnt[N];
int v[N];

void go(int x) {
  set<int>foo;
  while(is[x]) {
    foo.insert(is[x]);
    cnt[is[x]]++;
    x /= is[x];
  }
  if(x > 1) {
    foo.insert(x);
    cnt[x]++;
    x = 1;
  }
  for(set<int>::iterator it = foo.begin(); it != foo.end(); it++) {
    p2[*it] = max(p2[*it], cnt[*it]);
    cnt[*it] = 0;
  }
}

inline bool solve() {
  crivo();
  while(is[k]) {
    p1[is[k]]++;
    k /= is[k];
  }
  if(k > 1) {
    p1[k]++;
    k = 1;
  }
  for(int i = 1; i <= n; ++i) {
    go(v[i]);
  }
  for(int i = 0; i < N; ++i) {
    if(p1[i] > p2[i]) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%d", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
int p1[N], p2[N];
int v[N];

void go(int x) {
  while(is[x]) {
    p2[is[x]]++;
    x /= is[x];
  }
  if(x > 1) {
    p2[x]++;
    x = 1;
  }
}

inline bool solve() {
  crivo();
  while(is[k]) {
    p1[is[k]]++;
    k /= is[k];
  }
  if(k > 1) {
    p1[k]++;
    k = 1;
  }
  for(int i = 1; i <= n; ++i) {
    go(v[i]);
  }
  for(int i = 0; i < N; ++i) {
    if(p1[i] > p2[i]) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%d", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
}

int n, k;
int p1[N], p2[N];
set<int>s;
int v[N];

void go(int x) {
  while(is[x]) {
    p2[is[x]]++;
    x /= is[x];
  }
  if(x > 1) {
    s.insert(x);
    p2[x]++;
    x = 1;
  }
}

inline bool solve() {
  crivo();
  while(is[k]) {
    p1[is[k]]++;
    s.insert(is[k]);
    k /= is[k];
  }
  if(k > 1) {
    s.insert(k);
    p1[k]++;
    k = 1;
  }

  for(int i = 1; i <= n; ++i) {
    go(v[i]);
  }
  for(set<int>::iterator it = s.begin(); it != s.end(); it++) {
    if(p1[*it] > p2[*it]) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%d", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;

#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define LSONE(s) ((s)&(-s))
#define DEG_to_RAD(X)   (X * PI / 180)
#define F first
#define S second
#define PI 2*acos(0)

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

//////////////////////
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};
//////////////////////

const int N = 1000010;

int is[N];
int p[N], sz;

void crivo() {
  sz = 0;
  for(int i = 2; i < N; ++i) {
    if(!is[i]) {
      p[sz++] = i;
      for(int j = 1; j * i < N; ++j) is[i * j] = i;
    }
  }
  //debug("sz = %d\n", sz);
}

int n, k;
vi d;
int sol[N];
ll v[N];

inline bool solve() {
  for(int i = 1; i <= n; ++i) {
    sol[v[i]] = 1;
    if(v[i] >= k) return true;
  }
  for(int i = 2; i <= k; ++i) {
    if(sol[i] == 0) return false;
  }
  return true;
}

int main() {
  scanf("%d %d", &n, &k);
  for(int i = 1; i <= n; ++i) scanf("%lld", v + i);
  puts(solve() ? "Yes" : "No");
  return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int used[N];

bool func(int n) {
    int p = 2;
    bool f = true;
    while (!(p * p > n)) {
        if (n % p == 0) {
            int cnt = 0;
            while (n % p == 0) cnt ++, n /= p;
            if (used[p] < cnt) f = false;
            used[p] = max(used[p], cnt);
        } else p ++;
    }
    if (n > 1 && used[n] < 1)  {
        f = false;
        used[n] = 1;
    }
    return f;
}

int main() {

    int n, k, a;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        scanf("%d", &a);
        func(a);
    }
    if (func(k)) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int used[N];
vector <bool> prime(N, true);
vector <int> pr;

bool func(int n) {
    int p = 0;
    bool f = true;
    while (pr[p] * pr[p] <= n) {
        int t = pr[p];
        if (n % t == 0) {
            int cnt = 0;
            while (n % t == 0) cnt ++, n /= t;
            if (used[t] < cnt) f = false;
            used[t] = max(used[t], cnt);
        }
        p ++;
    }
    if (n > 1 && used[n] < 1)  {
        f = false;
        used[n] = 1;
    }
    return f;
}

int main() {
    prime[0] = prime[1] = false;
    for (int i = 2; i * i < N; i ++)
        if (prime[i]) {
            pr.pb(i);
            if (i * 1ll * i < N)
                for (int j = i * i; j < N; j += i)
                    prime[j] = false;
        }
    int n, k, a;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        scanf("%d", &a);
        func(a);
    }

    if (func(k)) printf("Yes\n");
    else printf("No\n");

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int main() {

    ll n, k, num = 1;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        ll a;
        scanf("%I64d", &a);
        ll g = __gcd(a, num);
        num = __gcd(a / g * num, k);
    }
    if (num == k) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

ll lcm(ll a, ll b) {
    return a / __gcd(a, b) * b;
}

int main() {

    ll n, k, num = 1;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        ll a;
        cin >> a;
        num = __gcd(lcm(a, num), k);
    }
    if (num == k) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int used[N];

bool func(int n) {
    int p = 2;
    bool f = true;
    while (!(p * p > n)) {
        if (n % p == 0) {
            int cnt = 0;
            while (n % p == 0) cnt ++, n /= p;
            if (used[p] < cnt) f = false;
            used[p] = max(used[p], cnt);
        } else p ++;
    }
    if (n > 1 && used[n] < 1)  {
        f = false;
        used[n] = 1;
    }
    return f;
}

int main() {

    int n, k, a;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        cin >> a;
        func(a);
    }
    if (func(k)) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int used[N];
vector <int> prime(N, true), pr;

bool func(int n) {
    int p = 2;
    bool f = true;
    for (int p : pr) {
        if (n % p == 0) {
            int cnt = 0;
            while (n % p == 0) cnt ++, n /= p;
            if (used[p] < cnt) f = false;
            used[p] = max(used[p], cnt);
        }
    }
    return f;
}

int main() {

    int n, k, a;
    cin >> n >> k;
    prime[0] = prime[1] = false;
    for (int i = 2; i < k; i ++)
        if (prime[i]) {
            pr.pb(i);
            if (i * 1ll * i < N)
                for (int j = i * i; j < N; j += i)
                    prime[j] = false;
        }
    for (int i = 1; i <= n; i ++) {
        cin >> a;
        func(a);
    }
    if (func(k)) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int main() {

    ll n, k, num = 1;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        ll a;
        scanf("%I64d", &a);
        ll g = __gcd(lcm(a, num);
        num = __gcd(a / g * num, k);
    }
    if (num == k) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int used[N];

bool func(int n) {
    int p = 2;
    bool f = true;
    while (p * p <= n) {
        if (n % p == 0) {
            int cnt = 0;
            while (n % p == 0) cnt ++, n /= p;
            if (used[p] < cnt) f = false;
            used[p] = max(used[p], cnt);
        } else p ++;
    }
    if (n != 1 && used[n] < 1) f = false;
    return f;
}

int main() {

    int n, k, a;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        cin >> a;
        func(a);
    }
    if (func(k)) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


# include <bits/stdc++.h>

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int IMX = (1 << 31) - 1;
const ll LMX = (1ll << 63) - 1;
const ld PI = 3.141592653589793;
const int eps = 1e-10;
const int base = 1e9;
const int N = 1000005;

int lcm(int a, int b) {
    return a / __gcd(a, b) * b;
}

int main() {

    int n, k, num = 1;
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) {
        int a;
        cin >> a;
        num = __gcd(lcm(a, num), k);
    }
    if (num == k) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch>'9' || ch<'0')
    {
        if(ch=='-')
        f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
int n,k;
int a[1000005];
int main()
{
    n=read(),k=read();
    for(int i=1;i<=n;i++)
    {
        a[i]=read();
    }
    int flag=0;
    int p=sqrt(k);
    for(int i=2;i<=p;i++)
    {
        flag=0;
        int res=1;
        if(k%a[i]==0)
        {
            while(k%i==0)
            {
                res=res*i;
                k/=i;
            }
            for(int j=1;j<=n;j++)
            {
                if(a[j]%res==0)
                {
                    flag=1;
                    break;
                }
            }
            if(flag==0)
            {
                printf("No\n");
                return 0;
            }
        }
    }
    flag=0;
    for(int i=1;i<=n;i++)
    {
        if(a[i]%k==0)
        {
            flag=1;
            break;
        }
    }
    if(flag==0)
    {
        printf("No\n");
    }
    else
    {
        printf("Yes\n");
    }
    return 0;
}


#include<cstdio>
using namespace std;
long long n,k,ans=1,bj;
long long c[1000010];
long long gcd(long long x,long long y)
{
	if (x%y) return gcd(y,x%y);
	return y;
}
long long lcm(long long x,long long y)
{
	return x*y/gcd(x,y);
}
int main()
{
	scanf("%lld%lld",&n,&k);
	for(int i=1;i<=n;i++) scanf("%lld",&c[i]);
	for(int i=1;i<=n;i++)
	{
		ans=lcm(ans,c[i])%k;
		if (!ans)
		{
			bj=1;break;
		}
	}
	if (bj) printf("Yes");
	else printf("No");
	return 0;
}


#include<iostream>
#include<cstdio>
#define int long long
using namespace std;
int n,k,LCM=1,t;
int gcd(int x,int y){return (!y)?x:gcd(y,x%y);}
int lcm(int x,int y){return (x*y)/gcd(x,y);   }
signed main()
{
	cin>>n>>k;
	while(n--)
	{
		cin>>t;
		LCM=lcm(LCM,t);
		LCM%=k;
	}
	cout<<((!LCM)?"Yes":"No");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <vector>
#include <stack>
#include <map>
#define ri register
#define inf 0x7fffffff
#define E (1)
#define mk make_pair
#define int long long
using namespace std; const int N=1000010;
inline int read()
{
	int s=0, w=1; ri char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-') w=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar(); return s*w;
}
void print(int x) {if(x<0) x=-x, putchar('-'); if(x>9) print(x/10); putchar(x%10+'0'); }
int n,k;
signed main()
{
	n=read(), k=read(); int lcm=1;
	for(ri int i=1;i<=n;i++)
	{
		int x=read();
		if(!lcm) continue;
		lcm=lcm*x/__gcd(lcm,x);
		lcm%=k;
	}
	(lcm)?puts("No"):puts("Yes");
	return 0;
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+5;
int n,k,a[N],ans=1;
int gcd(int x,int y){
	if(!y) return x;
	return gcd(y,x%y);
}
int lcm(int x,int y){
	return x/gcd(x,y)*y;
}
signed main(){
	scanf("%lld%lld",&n,&k);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
		ans=lcm(ans,a[i])%k;
	}
	if(!ans) puts("Yes");
	else puts("No");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
typedef long long ll;
ll n,k;
ll q[1000001];
ll g,gc;
inline ll read(){
	ll s=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return s;
}
inline ll gcd(ll a,ll b){
	return b?gcd(b,a%b):a;
}
int main(){
	n=read(),k=read();
	for(int i=1;i<=n;i++){
		q[i]=read();
	}
	g=q[1];
	for(int i=2;i<=n;i++){
		if(q[i]>g)g=g*q[i]/gcd(q[i],g);
		else g=g*q[i]/gcd(g,q[i]);
		g%=k;
	}
	return printf(g?"No":"Yes")&0;
}


#include <bits/stdc++.h>
using namespace std;
int n;
long long k,c;
long long f=1;
inline long long read(){
   long long s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
long long gcd(long long a,long long b)
{
	if(!b)return a;
	return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
	return a/gcd(a,b)*b;
}
int main()
{
	scanf("%d",&n);
	k=read();
	for(int i=1;i<=n;i++)
	{
		c=read();
		f=lcm(f,c);
		f%=k;
		if(!f)break;
	}
	if(f==0)cout<<"Yes";
	else cout<<"No";
}


#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
typedef long long ll;
ll n,k;
ll q[1000001];
ll g,gc;
inline ll read(){
	ll s=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return s;
}
inline ll gcd(ll a,ll b){
	return b?gcd(b,a%b):a;
}
int main(){
	n=read(),k=read();
	for(int i=1;i<=n;i++){
		q[i]=read();
	}
	g=q[1];
	for(int i=2;i<=n;i++){
		if(q[i]>g)g=g/gcd(q[i],g)*(q[i]%k)%k;
		else g=g/gcd(g,q[i])*(q[i]%k)%k;
		if(!g){
			return printf("Yes")&0;
		}
	}
	return printf(g?"No":"Yes")&0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n,k,a[N];
int main(){
	//freopen("in.txt","r",stdin);
	cin >> n >> k ;
	for(int i = 1 ; i <= n ; i++) scanf("%d",&a[i]);
	for(int i = 2 ; i <= k ; i++){
		if(k%i) continue;
		int c = 1 ; bool flag = false;
		while(k%i == 0) k /= i,c *= i;
		for(int j = 1 ; j <= n ; j++)
		    if(a[j]%c == 0) { flag = true ; break ;}
		if(!flag) {
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
using namespace std;
int n,k,a,b,i,j,l;
inline int read()
{
	int x=0,f=1;
	char c=getchar();
	while(c<'0' || c>'9')
	{
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0' && c<='9')
	{
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
int gcd(int x,int y)
{
	if(y==0)return x;
	return gcd(y,x%y);
}
int lcm(int q,int w)
{
	return q/gcd(q,w)*w;
}
int main()
{
	n=read();
	k=read();
	l=1;
	for(i=1;i<=n;i++)
	{
		a=read();
		b=gcd(a,k);
		l=lcm(b,l);
	}
	if(k==l)cout<<"Yes";
	else cout<<"No";
	return 0;
}


#include <bits/stdc++.h>

#define re register

const int MAXN = 1e6 + 10;

namespace TNT
{
    inline int read()
    {
        int x = 0;
        char ch = getchar();
        while (ch < '0' || ch > '9')
            ch = getchar();
        while (ch >= '0' && ch <= '9')
        {
            x = x * 10 + ch - '0';
            ch = getchar();
        }
        return x;
    }

    int c[MAXN],p[MAXN];

    inline void main()
    {
        int n = read(), k = read(), tot = 0;

        for (re int i = 1; i <= n; i++)
            c[i] = read();

        for (re int i = 2; i <= k; i++)
            if (!(k % i))
            {
                p[++tot] = 1;
                while (!(k % i))
                {
                    p[tot] *= i;
                    k /= i;
                }
            }

        bool flag = 0;
        for (re int i = 1; i <= tot; i++)
        {
            for (re int j = 1; j <= n; j++)
                if (!(c[j] % p[i]))
                    flag = 1;

            if (!flag)
            {
                puts("No");
                return;
            }
        }

        puts("Yes");
        return;
    }
} // namespace TNT

int main()
{
    TNT::main();
    return 0;
}


#include<iostream>
#include<cstdio>
#define ll long long

using namespace std;
ll n,k,tmp,x;

inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+(ch^48);ch=getchar();}
	return x*f;
}

ll gcd(ll m,ll n){
	return n==0?m:gcd(n,m%n);
}

ll lcm(int x,int y){
	return x/gcd(x,y)*y;
}

int main(){
	n=read();k=read();
	tmp=1;
	for(int i=1;i<=n;i++){
		x=read();
		if(!tmp) continue;
		tmp=lcm(tmp,x);
		tmp%=k;
	}
	printf("%s\n",!tmp?"Yes":"No");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define N 1000009
int c[N];

int main()
{
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;i++) scanf("%d",&c[i]);
    int m=sqrt(k);
    for(int i=2;i<=m;i++)
	{
        if(k%i==0)
		{
            int t=1;
            while(k%i==0) t*=i,k/=i;
            bool flag=0;
            for(int i=1;i<=n && !flag;i++)
                if(c[i]%t==0)
                    flag=1;
            if(!flag)
			{
                puts("No");
                return 0;
            }
        }
    }
    bool flag=0;
    for(int i=1;i<=n && !flag;i++)
        if(c[i]%k==0)
            flag=1;
    if(flag) puts("Yes");
    else puts("No");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
typedef long long ll;
ll n,k;
ll q[1000001];
ll g,gc;
inline ll read(){
	ll s=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return s;
}
inline ll gcd(ll a,ll b){
	return b?gcd(b,a%b):a;
}
int main(){
	n=read(),k=read();
	for(int i=1;i<=n;i++){
		q[i]=read();
	}
	g=q[1];
	for(int i=2;i<=n;i++){
		g=gcd(q[i],g);
	}
	gc=g;
	for(int i=2;i<=n;i++){
		g*=q[i]/gc%k;
		g%=k;
	}
	return printf(g?"No":"Yes")&0;
}


#include<iostream>
#include<cstdio>
#include<cctype>
using namespace std;
typedef long long ll;
ll n,k;
ll q[1000001];
ll g,gc;
inline ll read(){
	ll s=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return s;
}
inline ll gcd(ll a,ll b){
	return b?gcd(b,a%b):a;
}
int main(){
	n=read(),k=read();
	for(int i=1;i<=n;i++){
		q[i]=read();
	}
	g=q[1];
	for(int i=2;i<=n;i++){
		g=gcd(q[i],g);
	}
	gc=g;
	g=1;
	for(int i=2;i<=n;i++){
		g*=q[i]/gc%k;
		g%=k;
	}
	return printf(g?"No":"Yes")&0;
}


#include <bits/stdc++.h>

using namespace std;

long long n, k, a, b = 1;

long long gcd(long long a, long long b) {
	return b ? gcd(b, a % b) : a;
}

long long lcm(long long a, long long b) {
	return a / gcd(a, b) * b;
}

int main() {
	cin >> n >> k;
	for(long long i = 1; i <= n; ++i) {
		cin >> a;
		b = lcm(b, a);
		b %= k;
		if(!b) break;
	}
	if(!b) cout << "Yes";
	else cout << "No";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll n,k;
ll a;
ll m[1000001];
int main()
{
    cin>>n>>k;
    ll c=1;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        ll b=__gcd(c,a);

        c=((a*c)/b);
        p=__gcd(c,k);
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll lcm ( ll a , ll b ){
return a*b/__gcd(a,b);
}

ll n,k;
ll a;
ll m[1000001];
int32_t main()
{
    cin>>n>>k;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        p=__gcd(k,lcm(p,a));
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;

int n,k;
int a;
int main()
{
    cin>>n>>k;
    int c=1;
    for(int i=0;i<n;i++)
        {cin>>a;
        int b=__gcd(c,a);
        c=(((a*c)%k)/b)%k;
}

    if(c==0)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll lcm ( ll a , ll b ){
return a*b/__gcd(a,b);
}
ll gcd ( ll a , ll b ){
    return __gcd(a,b);
}
ll n,k;
ll a;
ll m[1000001];
int32_t main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin>>n>>k;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        p=gcd(k,lcm(p,a));
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef int ll;
using namespace std;

ll n,k;
ll a;
ll m[1000001];
int main()
{
    cin>>n>>k;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        ll b=__gcd(p,a);
        p=((a*p)/b);
        p=__gcd(p,k);
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll lcm ( ll a , ll b ){
return a*b/__gcd(a,b);
}
ll gcd ( ll a , ll b ){
    return __gcd(a,b);
}
ll n,k;
ll a;
ll m[1000001];
int32_t main()
{
    cin>>n>>k;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        p=gcd(k,lcm(p,a));
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


//In the Name Of God

#include <bits/stdc++.h>
using namespace std;
int n,k;
long long int a;

int main(){
cin>>n>>k;
for (int i=0; i<n ; i++){
cin>>a;
if(a%k==0){cout<<"YES";return 0 ;}
}
cout<<"NO";return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll n,k;
ll a;
ll m[1000001];
int main()
{
    cin>>n>>k;
    ll p=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        ll b=__gcd(p,a);

        p=((a*p)/b);
        p=__gcd(p,k);
}

    if(p==k)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll n,k;
ll a;
ll m[1000001];
int main()
{
    cin>>n>>k;
    ll c=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        if(m[a]==0)
        m[a]=__gcd(c,a);

        c=((a*c)/m[a])%k;
}

    if(c==0)cout<<"YES";
    else
        cout<<"NO";
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll n,k;
ll a;
int main()
{
    cin>>n>>k;
    ll c=1;
    for(ll i=0;i<n;i++)
        {cin>>a;
        ll b=__gcd(c,a);
        c=((a*c)/b)%k;
}

    if(c==0)cout<<"YES";
    else
        cout<<"NO";
}


#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define int long long
const int N = 0, mod = 0;

int gcd(int x, int y) { return __gcd(x, y); }
long long lcm(int x, int y) { return x * 1ll * y / gcd(x, y); }

int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, k;
    cin >> n >> k;
    int cur = 1;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        cur = gcd(k, lcm(cur, x));
    }
    if (cur == k) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long LL;

LL gcd(LL a, LL b) {
  return __gcd(a, b);
}

LL lcm(LL a, LL b) {
  return a * 1ll * b / gcd(a, b);
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  int n, k;
  cin >> n >> k;
  LL cur = 1;
  for (int i = 0; i < n; ++i) {
    LL x;
    cin >> x;
    cur = gcd(k, lcm(cur, x));
  }

  if (cur == k) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long LL;

static const int N = 1000005;

inline int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

inline LL lcm(int a, int b, int k) {
  int g = gcd(a, b);
  return (LL((a / g) % k) * (b % k)) % k;
}

int main() {
  int n, k, c, llcm;
  cin >> n >> k >> llcm;
  for (int i = 1; i < n; ++i) {
  	cin >> c;
    llcm = lcm(llcm, c, k);
  }

  if (llcm) {
  	cout << "No" << endl;
  } else {
  	cout << "Yes" << endl;
  }

  return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long LL;

static const int N = 1000005;

inline int gcd(int a, int b) {
  return __gcd(a, b);
}

LL lcm(int a, int b) {
  return a * 1LL * b / gcd(a, b);
}

int main() {
  int n, k;
    cin >> n >> k;
    int cur = 1;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        cur = gcd(k, lcm(cur, x));
    }
    if (cur == k) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

  return 0;
}