#include using namespace std; using ll = long long; int main(){ ll n, x; cin >> n >> x; ll l = 0; for(int b = 1; b <= n; b++){ if(n % b == 0)l = n / b; for(int a = 1; pow(a,x) <= l; a++){ if(pow(a,x) == l){ if(a != b){ cout << "Yes" << endl; return 0; } } } } cout << "No" << endl; return 0; }