#include using namespace std; using ll = long long; const int INF = 1e9 + 10; const ll INFL = 4e18; int main() { string A, B; cin >> A >> B; int dot = ranges::find(A, '.') - A.begin(); if (A.substr(dot) != ".0000") return puts("No"), 0; A.resize(dot); int a = stoi(A); vector pf; for (int i = 2; i * i <= a; i++) { if (a % i) continue; int cnt = 0; while (a % i == 0) { a /= i; cnt++; } pf.push_back(cnt); } if (a > 1) pf.push_back(1); B.erase(ranges::find(B, '.')); ll bup = stoll(B), blo = 10000; ll g = gcd(bup, blo); bup /= g; blo /= g; for (ll &p : pf) p *= bup; bool ans = true; for (ll p : pf) { if (p % blo) ans = false; } puts(ans ? "Yes" : "No"); }