#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

vector<long long> enum_divisors(long long N) {
    vector<long long> res;
    for (long long i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    
    return res;
}

int main() {
    long long S, P;
    cin >> S >> P;
    const auto &res = enum_divisors(P);
    for (int i = 0; i < res.size(); ++i) {
        long long N = res[i];
        long long M = P / N;

        if(N + M == S) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
const ll maxn =6e5+10;
const ll mod=1e9+7;
const ll base=1e18;

ll cnt[maxn];
ll f[maxn];

ll get_duong(ll a,ll b)
{
    if (b<0) return 0;
    ll kc=b/2;
    ll ans=0;
    if (a<=kc)
    {
        ans=ans+2*a+1;
    }
    else
    {
        ans=ans+kc+1;
        ll cl=b-kc*2;
        if (cl>=1)
        {
            ans=ans+kc+1;
        }
        else
        {
            ans=ans+kc;
        }
    }
    return ans;
}
ll get_am(ll a,ll b)
{
    if (b<=0) return 0;
    ll kc=b/2;
    ll ans=2*kc;
    if (b%2==0)
        ans--;
    return ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    if (fopen("t.inp","r"))
    {
        freopen("test.inp","r",stdin);
        freopen("test.out","w",stdout);
    }
    ll a, b;
    cin>> a>> b;

    if (a==0)
    {
        ll ans=get_am(a,b)+1;
        cout <<ans<<endl;
    }
    else if (a>0)
    {
        ll ans=get_duong(a,b)+get_am(a,b-1);
        cout <<ans<<endl;
    }
    else
    {
        ll ans=get_am(a,b)+get_duong(-a,b-1);
        cout <<ans<<endl;
    }

}
