#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for (int i = 0; i < (int)(n); ++i) //#define cerr if(false) cerr #ifdef DEBUG #define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__); #else #define show(...) 42 #endif using namespace std; using ll = long long; using pii = pair; template ostream& operator<<(ostream& os, pair a) { os << '(' << a.first << ',' << a.second << ')'; return os; } template ostream& operator<<(ostream& os, vector v) { for (auto x : v) os << x << ' '; return os; } void debug() { cerr << '\n'; } template void debug(H a, T... b) { cerr << a; if (sizeof...(b)) cerr << ", "; debug(b...); } int main(){ int n; ll z; cin >> n >> z; if(n >= 3){ puts("No"); return 0; } if(n == 1){ if(z == 1)puts("No"); else puts("Yes"); }else{ for(ll x = 1; x <= z; x++){ ll y = sqrt(z * z - x * x); if(y > 0 and y * y + x * x == z * z){ puts("Yes"); return 0; } y++; if(y > 0 and y * y + x * x == z * z){ puts("Yes"); return 0; } y -= 2; if(y > 0 and y * y + x * x == z * z){ puts("Yes"); return 0; } } puts("No"); } }