#include #include using namespace std; using ull = unsigned long long; __int128_t pow(__int128_t a, __int128_t n, __int128_t m) { __int128_t x = a; __int128_t ret = 1ull; while (n) { if (n & 1ull) { ret *= x; ret %= m; } x *= x; x %= m; n = (n >> 1); } return ret; } bool MR(ull n, int k) { if (n == 2) return true; if (n%2==0) return false; if (n == 1) return false; int s = 1; while ((((n-1)>>s) & 1ull) == 0ull) s++; ull t = (n-1)>>s; for (int i=0;i> x; int c = 0; while (!((x >> c) & 1ull)) { c++; } if ((x >> c) == ((1ull << (c+1))-1)) { if (MR((1ull<<(c+1))-1, 10)) { cout << "Yes"; } else { cout << "No"; } } else { cout << "No"; } }