#include #include #include using namespace std; using INT = unsigned long long; INT _pow(INT a, INT b) { INT c = a; while (--b > 0) { c *= a; } return c; } const char *solve(INT n, INT z) { const INT A = pow(z, n); INT x, y; x = 1; while (1) { y = 1; while (1) { INT a = _pow(x, n) + _pow(y, n); if (a == A) { return "Yes"; } if (a > A) { if (y == 1) { return "No"; } break; } y++; } x++; } } int main() { INT n, z; cin >> n >> z; cout << solve(n, z) << endl; }