#include #include #include #include #include #include using namespace std; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) int main(){ int n,z; cin >> n >> z; if (n >= 3) cout << "NO" << endl; else if (n == 2){ z *= z; for (int x = 1; x <= 1000;x++){ if (z-x*x >= 1){ for (int tmp = 1; tmp*tmp <= z-x*x;tmp++){ if (tmp * tmp == z-x*x) { cout << "YES" << endl; return 0; } } } } } else cout << "YES" << endl; return 0; }