#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
using namespace std;
const ll MOD=998244353;
int n,k;
ll fact[500005],inv[500005];
ll quick_pow(ll x,ll a)
{
	ll ans=1;
	while(a)
	{
		if(a&1)ans=ans*x%MOD;
		x=x*x%MOD;
		a>>=1;
	}
	return ans;
}
int main()
{
	scanf("%d%d",&n,&k);
	fact[0]=1;
	for(int i=1;i<=500000;i++)fact[i]=fact[i-1]*i%MOD;
	inv[500000]=quick_pow(fact[500000],MOD-2);
	for(int i=500000;i>=1;i--)inv[i-1]=inv[i]*i%MOD;
	ll ans=0;
	for(int r=k;r*2>=k;r--)
	{
		int b=k-r;
		if(b==r)b--;
		if(r-n<0)break;
		ans+=fact[r+b]*inv[r]%MOD*inv[b]%MOD;
		if(r-n+1<=b)ans-=fact[r+b]*inv[b-(r-n+1)]%MOD*inv[r+(r-n+1)]%MOD;
	}
	ans%=MOD;
	if(ans<0)ans+=MOD;
	printf("%lld\n",ans);
	return 0;
}