#include using namespace std; #include using namespace atcoder; #define rep(i, s, e) for (int i = s; i < e; ++i) #define sort_(a) stable_sort(a.begin(), a.end()) #define rsort(a) stable_sort(a.rbegin(), a.rend()) #define sum(a) accumulate(a.begin(), a.end(), 0LL) #define join(a, d) accumulate(a.begin() + 1, a.end(), a[0], [](string s, string t) { return s + d + t; }) #define all(a) a.begin(), a.end() #define degrees(a) a * 180.0 / M_PI; #define radians(a) (a * M_PI) / 180.0; typedef long long ll; using mint = modint; int main(int, [[maybe_unused]] char* argv[]) { #ifdef DEBUG freopen(argv[1], "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); int N, M; cin >> N >> M; mint::set_mod(N); map nums; int x; rep(i, 0, N) { x = mint(i + 1).pow(M).val(); nums[x] += 1; if (nums[x] > 1) { cout << "No\n"; return 0; } } cout << "Yes\n"; return 0; }