#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) using namespace std; vector divEnumeration(int num) { vector res; if (num == 1) { res.emplace_back(1); return res; } int mod = 2; while (mod * mod <= num) { if (num % mod == 0) { res.emplace_back(mod); num /= mod; } else { if (mod == 2) { mod++; } else { mod += 2; } } } res.emplace_back(num); return res; } int main() { fastIO; int n, h; cin >> n >> h; map mp; for (const auto mod : divEnumeration(h)) { if (mp.find(mod) != mp.end()) { mp[mod] += 1; } else { mp[mod] = 1; } } for (int i = 0, num; i < n; ++i) { cin >> num; for (const auto mod : divEnumeration(num)) { if (mp.find(mod) != mp.end()) { mp[mod]--; } } } bool isDivide = true; for (const auto m : mp) { if (m.second > 0) { isDivide = false; } } if (isDivide) cout << "YES" << '\n'; else cout << "NO" << '\n'; return 0; }