#include using namespace std; using ll = long long; using ul = unsigned long; using ull = unsigned long long; vector > primeFactorize(ll n) { vector > res; for (ll a = 2; a * a <= n; ++a) { if (n % a != 0) continue; ll ex = 0; while (n % a == 0) { ++ex; n /= a; } res.push_back({ a, ex }); } if (n != 1) res.push_back({ n, 1 }); return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll a, b; cin >> a >> b; if ((a % b) == 0) { cout << "No\n"; return 0; } vector > va = primeFactorize(a); map p; for (const auto& it : va) p[it.first] = it.second; vector > vb = primeFactorize(b); for (const auto& it : vb) { if (it.first != 2 && it.first != 5) { if ((ll)p.count(it.first) < it.second) { cout << "Yes\n"; return 0; } } } cout << "No\n"; return 0; }