#include #include #include #include using namespace std; using ll=long long; const long long INF = 1LL << 60; template void chmin(T& a, T b) { if(a > b) { a = b; } } template void Sort(vector& input) { std::sort(input.begin(), input.end()); } int main() { int N, H; cin >> N >> H; vector A = vector(N, 0); ll p = 1; for(int i=0; i> tmp; p = (p*tmp)%H; } //cout << p << endl; if(p==0) cout << "YES" << endl; else cout << "NO" << endl; }