#include //#include using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; map prime; void prime_factor(ll n){ prime.clear(); ll m = n; if (n % 2 == 0){ while(n % 2 == 0){ prime[2]++; n /= 2; } } for (ll i = 3; i*i <= m; i+=2){ if (n % i == 0){ while(n % i == 0){ prime[i]++; n /= i; } } } if (n != 1){ prime[n]++; } } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); /* A = A*10^4/10^4として素因数分解 A = prod_i p_i^e_i A^B = prod_i p_i^Be_i すべてのiについて、Be_iは非負整数か? B*10^4*e_i/10^4は非負整数か? */ string AA, BB; cin >> AA >> BB; ll A, B, z=10000; A = stoll(AA.erase(AA.size()-5, 1)); B = stoll(BB.erase(BB.size()-5, 1)); prime_factor(A); map mp = prime; prime_factor(z); for (auto [x, y] : prime) mp[x] -= y; for (auto [x, y] : mp){ if ((B * y) % z != 0 || (B * y) / z < 0){ cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }