#include<bits/stdc++.h>
using namespace std;

const int N=1000000,mod=998244353;
int n,k,jc[1000010],inv[1000010],ans;

int quickmi(int a,int b)
{
	int t=1;
	for (; b; b>>=1,a=1ll*a*a%mod)
		if (b&1) t=1ll*t*a%mod;
	return t;
}

int calc(int x,int y,int T)
{
	if (y-x>=T||x<0||y<0||T<=0) return 0;
	if (T>y) return 1ll*jc[x+y]*inv[x]%mod*inv[y]%mod;
	return (1ll*jc[x+y]*inv[x]%mod*inv[y]+1ll*(mod-jc[x+y])*inv[x+T]%mod*inv[y-T])%mod;
}

int main()
{
	jc[0]=1;
	for (int i=1; i<=N; i++) jc[i]=1ll*jc[i-1]*i%mod;
	inv[N]=quickmi(jc[N],mod-2);
	for (int i=N; i; i--) inv[i-1]=1ll*inv[i]*i%mod;
	scanf("%d%d",&n,&k),ans=0;
	for (int R=max(n,(k+1>>1)); R<=k; R++)
		ans=(ans+calc(R,k-R,R-n+1)-(R==k-R?calc(k-R-1,k-R,R-n+1):0))%mod;
	return printf("%d\n",ans),0;
}