#include using namespace std; /* typedef */ typedef long long ll; typedef pair pii; /* constant */ const int INF = 1 << 30; const ll LINF = 1LL << 50; const int NIL = -1; const int MAX = 10000; const int mod = 1000000007; const double pi = 3.141592653589; /* global variables */ /* function */ /* main */ int main(){ int n, z; cin >> n >> z; set s; for (int x = 1; x < z; x++) { int x_n = pow(x , n); s.insert(x_n); } vector y; int z_n = pow(z, n); for (int x_n : s) { y.push_back(z_n - x_n); } for (int i = 0; i < y.size(); i++) { if (s.count(y[i])) { cout << "Yes" << '\n'; return 0; } } cout << "No" << '\n'; }