#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; map pf(ll x) { map ret; for (ll i = 2; i * i <= x; i++) { if (x % i != 0) continue; int c = 0; while (x % i == 0) { x /= i; c++; } ret[i] = c; } if (x > 1) ret[x] = 1; return ret; } int main() { string A, B; cin >> A >> B; A.erase(ranges::find(A, '.')); B.erase(ranges::find(B, '.')); ll aup = stoi(A), bup = stoll(B); ll alo = 10000, blo = 10000; { ll ga = gcd(aup, alo), gb = gcd(bup, blo); aup /= ga; alo /= ga; bup /= gb; blo /= gb; } auto p_aup = pf(aup), p_alo = pf(alo); for (auto [k, v] : p_alo) p_aup[k] -= v; bool ans = true; for (auto [k, v] : p_aup) { v *= bup; if (v % blo != 0) ans = false; v /= blo; if (v < 0) ans = false; } puts(ans ? "Yes" : "No"); }