#include #define rep(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; template inline bool chmin(T& a, T b) { if(a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if(a < b) { a = b; return true; } return false; } struct Unionfind { vector par; Unionfind(int n) : par(n) { for(int i = 0; i < n; ++i) par[i] = i; } int root(int x) { if(par[x] == x) return x; return par[x] = root(par[x]); } void unite(int x, int y) { int rx = root(x); int ry = root(y); if(rx == ry) return; par[rx] =ry; } bool same(int x, int y) { int rx = root(x); int ry = root(y); return rx == ry; } }; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, z; cin >> n >> z; if(n == 1) { if(z != 1) { cout << "Yes" << endl; return 0; } else { cout << "No" << endl; return 0; } } if(n == 2) { for(int x = 1; x <= 1e3; ++x) { for(int y = 1; y <= 1e3; ++y) { if(x*x + y*y == z * z) { cout << "Yes" << endl; return 0; } } } cout <<"No" << endl; return 0; } if(n >= 3) { for(int x = 1; x <= 1e2; ++x) { for(int y = 1; y <= 1e2; ++y) { int xv = 1; int yv = 1; int zv = 1; rep(i, n) { xv *= x; yv *= y; zv *= z; } if(xv + yv == zv) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; return 0; } return 0; }