#include using namespace std; template int pow(int x, T n, int mod = std::numeric_limits::max()) { int res = 1; while (n > 0) { if (n & 1) res = static_cast(res) * static_cast(x) % mod; x = static_cast(x) * static_cast(x) % mod; n >>= 1; } return res; } int sqrt(int x, int n) { int lo = 0, hi = x; while (lo <= hi) { int mi = (lo + hi) / 2; if (pow(mi, n) == x) { return mi; } else if (pow(mi, n) < x) { lo = mi + 1; } else { hi = mi - 1; } } return -1; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, z; cin >> n >> z; int zn = pow(z, n); for (int i = 1; i < z + 1; i++) { if (zn - pow(i, n) < 1) continue; int j = sqrt(zn - pow(i, n), n); if (j != -1) { cout << "Yes" << '\n'; return 0; } } cout << "No" << '\n'; return 0; }