#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll=long long; template using V = vector; template using P = pair; using vll = V; using vvll = V; #define ALL(v) v.begin(),v.end() template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; } template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; } #define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<> n >> z; if (n >= 3) cout << "No\n"; else { int zn = 1; for (int i = 0; i < n; i++) zn *= z; set xns; for (int x = 1; x < z; x++) { int xn = 1; for (int j = 0; j < n; j++) xn *= x; xns.insert(xn); } for (int xn: xns) { if (xns.find(zn - xn) != xns.end()) { cout << "Yes\n"; return 0; } } cout << "No\n"; } return 0; }