#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; if (A.substr(ranges::find(A, '.') - A.begin()) != ".0000") { assert(false); puts("No"); return 0; } A.resize(ranges::find(A, '.') - A.begin()); ll a = stoi(A); vector pf; for (int i = 2; i * i <= a; i++) { if (a % i != 0) 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; bool ans = true; for (ll p : pf) if ((p * bup) % blo != 0) ans = false; puts(ans ? "Yes" : "No"); }