#ifdef t9unkubj
#include"debug.cpp"
//#include"template_no_debug.h"
#else 
#define dbg(...) 199958
#endif

#undef _GLIBCXX_DEBUG
#pragma GCC optimize("O3")
using namespace std;
#include<bits/stdc++.h>
using ll=long long;
using ull=unsigned long long;
template<class T>using vc=vector<T>;
template<class T>using vvc=vc<vc<T>>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(j);i<(ll)(n);i++)
#define DREP(i,n,m) for(ll i=(n);i>=(m);i--)
#define drep(i,n) for(ll i=((n)-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
template<class T,class F>
bool chmin(T &x, F y){
    if(x>y){
        x=y;
        return true;
    }
    return false;
}
template<class T, class F>
bool chmax(T &x, F y){
    if(x<y){
        x=y;
        return true;
    }
    return false;
}
double pass_time=0;
void solve(){
    double a,b;
    cin>>a>>b;
    
    int B=b*10000;
    //はい
    if(B==0){
        cout<<"Yes\n";
        return;
    }
    int A1=a*10000,A2=10000;

    if(B<0){
        swap(A1,A2);
        B=-B;
    }

    dbg(A1,A2);
    if(A1%A2){ 
        cout<<"No\n";
        return;
    }
    A1/=A2;

    //A1^Bの10000乗根が存在するか
    int cons=A1;
    vc<ll> coef;
    for(int i=2;i<=cons;i++){
        int cnt=0;
        while(A1%i==0)cnt++,A1/=i;
        coef.push_back(cnt);
    }
    for(auto&x:coef)x*=B;
    for(auto&x:coef){
        if(x%10000){
            cout<<"No\n";
            return;
        }
    }
    cout<<"Yes\n";
}
signed main(){
    cin.tie(0)->sync_with_stdio(0);
    pass_time=clock();
    int t=1;
    //cin>>t;
    while(t--)solve();
    pass_time=clock()-pass_time;
    dbg(pass_time/CLOCKS_PER_SEC);
}