#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //fixed #include //setprecision #include //swap, pair #include //abs(int) #include //sqrt,ceil,M_PI, pow, sin #include //stringstream,getline #include //gcd, accumlate #include //deque #include //randam_device #include //numeric_limits using namespace std; constexpr long long int D_MOD = 1000000007; inline int Greatest_Common_Divisor(int a, int b) { //aとbの最大公約数を返す while (a != 0 && b != 0) { if (a > b) { a = a - b; } else { b = b - a; } } return(a + b); } int main() { int N, H; cin >> N >> H; int temp = 0; int gcd = 0; for (int i = 0; i < N; i++) { cin >> temp; if (temp % H == 0) { cout << "YES" << endl; return 0; } else { gcd = Greatest_Common_Divisor(temp, H); H = H / gcd; } if (H == 1) { cout << "YES" << endl; return 0; } } cout << "NO" << endl; return 0; }