#include using namespace std; typedef long long ll; const int INF = 1000000000; const ll INFL = 2e18; template bool chmin(T &a, T b){ if (a > b) { a = b; return true;} else return false;} template bool chmax(T &a, T b){ if (a < b) { a = b; return true;} else return false;} int main() { int A,B; cin >> A >> B; map mpA; map mpB; for (int i = 2;i * i <= A;i++) { while (A % i == 0){ A /= i; mpA[i]++; } } if (A != 1)mpA[A]++; for (int i = 2;i * i <= B;i++) { while (B % i == 0){ B /= i; mpB[i]++; } } if (B != 1)mpB[B]++; bool flag = true; for (auto p:mpA) { flag &= (p.second * B == mpB[p.first] * A); } for (auto p:mpB) { flag &= (p.second * A == mpA[p.first] * B); } if (flag)cout << "Yes" << endl; else cout << "No" << endl; }