#include <iostream>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
using ll = long long; 
using P = pair<int,int>;

template <class _T> inline bool chmax (_T& a,_T b){if(a<b){a=b;return true;}return false;}
template <class _T> inline bool chmin (_T& a,_T b){if(a>b){a=b;return true;}return false;}
const int inf = 2147483647;
const long long INF = 1LL << 60;
const int MAX_N = 11000;
const int MAX_W = 10100;
ll mod = 1000000007;
ll MOD = 998244353;

int main(void){
    ll b,c;
    cin >> b >> c;
    ll ans = 0;
  	if(c==1 && b != 0){
    	cout << 2 << endl;
    	return 0;
    }
    if(b>0){
    //0 <= |b|の部分
	if( b-c/2 <= 0){ 
	    ans += 2*b+1;
	}else if( b-c/2 > 0 ){
	    if(c%2==0){
		ans += (c/2)*2+1;
	    }else{
		ans += (c/2)*2+2;
	    }
	}
    // |b|より大きい部分
	c--;
	if(c%2==0){
	    ans += (c/2)*2-1;
	}else{
	    ans += (c/2)*2;
	}
    }else if(b==0){
	ans++;
	if(c%2==0){
	    ans += (c/2)*2-1;
	}else{
	    ans += (c/2)*2;
	}
    }else{
    //0 < |b|の部分
	c--;
	if(-b-c/2 <= 0){
	    ans += 2*(-b)+1;
	}else if( -b-c/2 > 0){
	    if(c%2==0){
		ans += (c/2)*2+1;
	    }else{
		ans += (c/2)*2+2;
	    }
	}
        c++;
    // |b|より大きい部分
	if(c%2==0){
	    ans += (c/2)*2-1;
	}else{
	    ans += (c/2)*2;
	}
    }
    cout << ans << endl;
    return 0;   
}


#include <bits/stdc++.h>
/// 500 485 462 A4
using namespace std;
typedef long long int ll;
typedef complex<double> point;
typedef long double ld;
#define pb push_back
#define pii pair < ll , ll >
#define F first
#define S second
#define endl '\n'
#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define kill(x) return cout<<x<<'\n', 0;
const int N=2e5+100;
ll mod=998244353;
ll power(ll n,ll k){
    if (k==0) return 1;
    if (k%2==1){
        ll x=power(n,k/2);
        return x*x%mod*n%mod;
    }
    ll x=power(n,k/2);
    return x*x%mod;
}
ll fac[N];
ll fm[N];
ll ent(ll k,ll n){
    if (k==0 || k==n) return 1;
    if (k<0 || k>n) return 0;
    return fac[n]*fm[k]%mod*fm[n-k]%mod;
}
vector <int> p[N];
int32_t main(){
    sync;
    fac[0]=1;
    fm[0]=1;
    for (int i=1;i<N;i++){
        fac[i]=fac[i-1]*i%mod;
        fm[i]=power(fac[i],mod-2);
    }
    for (int i=2;i<N;i++){
        if (p[i].size()) continue;
        for (int j=i;j<N;j+=i){
            p[j].pb(i);
        }
    }
    ll ans=0;
    ll n,m;
    cin >> n >> m;
    for (int i=1;i<=m;i++){
        ll jav=1;
        for (auto u : p[i]){
            ll z=i,t=0;
            while(z%u==0){
                t++;
                z/=u;
            }
            jav*=ent(n-1,t-1+n);
            jav%=mod;
         //   cout << i << " " << u <<" " << t  << " " << jav<< endl;
        }
        ans+=jav;
    }
    cout << ans%mod << endl;
}
