#include using namespace std; int main(void) { int N, M; cin >> N >> M; vector seen(N, false); for(int i = 0; i < N; ++i) { long long t = 1; for(int j = 0; j < M; ++j) t = (t * i) % N; if(seen[t]) { cout << "No\n"; return 0; } seen[t] = true; } cout << "Yes\n"; return 0; }