#include using namespace std; int Pow(int x, int n) { int res = 1; while(n > 0) { if(n & 1) res = res * x; x = x * x; n = n >> 1; } return res; } bool solve() { int n, z; cin >> n >> z; map mp; int zn = Pow(z, n); for(int i = 1; i < z; ++i) { int x = Pow(i, n); mp[x]++; int y = zn - x; if(mp[y]) return true; } return false; } int main() { cout << (solve() ? "Yes" : "No") << '\n'; }