#include <bits/stdc++.h>

using namespace std;

using ll = long long;

constexpr char newl = '\n';

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    ll z;
    cin >> n >> z;

    if (n >= 3) {
        cout << "No\n";
    } else if (n == 1) {
        cout << (z == 1 ? "No" : "Yes") << newl;
    } else {
        ll z2 = z * z;
        for (ll x = 1; x <= z; x++) {
            for (ll y = 1; y <= z; y++) {
                if (x * x + y * y == z2) {
                    cout << "Yes\n";
                    return 0;
                }
            }
        }
        cout << "No" << newl;
    }
    return 0;
}