#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;
const ll MOD = 1000000007;

int main(){
    ll S , P ;
    cin >> S >> P;

    // M = S - Nを代入して N*(S-N) = Pをルートまで

    for(ll i = 0; i*i <= P; i++){
        if(i* (S-i) == P){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;


}
#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using ll = long long;
using lint = long long;
typedef vector<long long> vint;
typedef pair<long long, long long> pint;
#define MD 1000000007
#define INF INT32_MAX / 2
#define INF64 INT64_MAX / 2
#define EPS 0.001
#define REP(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define c(n) cout<<n<<endl;
#define cf(n) cout<<fixed<<setprecision(15)<<n<<endl;
template <class T>inline bool chmin(T&a,T b) {if(a>b){a=b;return true;}return false;}
template <class T>inline bool chmax(T&a,T b) {if(a<b){a=b;return true;}return false;}
template<class T>inline T sum(T n){return n*(n+1)/2;}
map<ll,ll> prime_fac(ll A) {map<ll,ll>mp;for(ll i=2;i*i<=A;i++){while(A%i== 0){mp[i]++;A/=i;}}if(A!=1){mp[A]=1;}return mp;}
bool is_prime(ll N){if(N<=1)return false;for(ll i=2;i*i<=N;i++){if(N%i==0) return false;}return true;}
template<class T>inline T myceil(T a,T b){return (a+(b-1))/b;}
bool is_product_overflow(long long a,long long b) {long prod=a*b;return (prod/b!=a);}

const string YES = "Yes";
const string NO = "No";

void solve(long long S, long long P){
    auto map = prime_fac(P);
    vint vec;
    ll sum = 1;
    for (auto m : map) {
        REP (i, m.second) {
            vec.push_back(m.first);
            sum *= m.first;
        }
    }
    ll size = vec.size();
    for (int bit = 0; bit < (1 << size); bit++) {
        ll cur = 1;
        ll sm = sum;
        for (int i = 0; i < size; i++) {
            if (bit & (1 << i)) {
                cur *= vec[i];
                sm /= vec[i]; 
            }
        }
        if (cur + sm == S) {
            c(YES)
            return;
        }
    }
    c(NO)
}

int main(){
    long long S;
    scanf("%lld",&S);
    long long P;
    scanf("%lld",&P);
    solve(S, P);
    return 0;
}
