#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>>>; #define MAX 1000000 #define MOD 1000000007 #define INF 1000000000 int main(){ ll A,B; cin>>A>>B; bool flag=true; ll a=A; ll b=B; for(ll i=2;i<=100000;i++){ ll cnt1=0; ll cnt2=0; while(a%i==0){ a/=i; cnt1++; } while(b%i==0){ b/=i; cnt2++; } if(cnt1*B!=cnt2*A){ flag=false; } } if(a>1||b>1){ if(A!=B){ flag=false; } } if(flag==true){ cout<<"Yes"<