#include "bits/stdc++.h" // Begin {{{ using namespace std; #define all(x) x.begin(), x.end() #define rep(i, n) for (i64 i = 0; i < (n); ++i) #define reps(i, b, e) for (i64 i = (b); i <= (e); ++i) #define repr(i, b, e) for (i64 i = (b); i >= (e); --i) #define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__) #ifdef DEBUG #define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__); #else #define dump(...) #endif using i64 = int_fast64_t; using pii = pair; template inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } constexpr int INF = 0x3f3f3f3f; constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr int MOD = int(1e9) + 7; // input void input() {} template void input(Head&& head, Tail&&... tail) { cin >> head; input(forward(tail)...); } // outs void outs() {} template void outs(Head&& head, Tail&&... tail) { cout << head << " \n"[sizeof...(tail)==0]; outs(forward(tail)...); } template void outs(vector &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; } template void outs(vector> &df) { for (auto &vec : df) OUTS(vec); } // outl void outl() {} template void outl(Head&& head, Tail&&... tail) { cout << head << "\n"; outl(forward(tail)...); } template void outl(vector &vec) { for (auto &e : vec) cout << e << "\n"; } // outn void outn() {} template void outn(Head&& head, Tail&&... tail) { cout << head; outn(forward(tail)...); } template void outn(vector &vec) { for (auto &e : vec) cout << e; } // dump template void dump_(const char *s, T&& x) { clog << '{'; while(*s != '\0') clog << *(s++); clog << ": " << x << '}' << "\n"; } template void dump_(const char *s, Head&& head, Tail&&... tail) { clog << '{'; while(*s != ',') clog << *(s++); clog << ": " << head << "}, "; for (++s; !isgraph(*s); ++s); dump_(s, forward(tail)...); } // }}} End vector divisor(i64 n) { vector ret; for (i64 i = 1; i * i <= n; ++i) { if (n % i == 0) { ret.push_back(i); if (i * i != n) ret.push_back(n / i); } } sort(all(ret)); return ret; } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); var(int, a, b); for (auto e : divisor(a)) { if (e % b == 0) { outl("YES"); return 0; } } outl("NO"); return 0; }