#define _USE_MATH_DEFINES #include <iostream> //cin, cout #include <vector> //vector #include <algorithm> //sort,min,max,count #include <string> //string,getline, to_string #include <ios> //fixed #include <iomanip> //setprecision #include <utility> //swap, pair #include <cstdlib> //abs(int) #include <cmath> //sqrt,ceil,M_PI, pow, sin #include <sstream> //stringstream,getline #include <numeric> //gcd, accumlate #include <deque> //deque #include <random> //randam_device #include <limits> //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; temp = abs(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; }