#include #include using namespace std; int gcd(int n1, int n2) { int ret = n1 % n2; return (ret == 0) ? n2 : gcd(n2, ret); } double A, B; int main() { cin>>A>>B; if(B>=0) { double p = 10000/gcd((int)B*10000, 10000); int r = round(pow(A, 1.0 / p)); if(A == pow(r, p)) cout<<"Yes"<