#include<cstdio>
#include<algorithm>
using namespace std;
const int N=5e5+5;
const int mod=998244353;
int inv[N],jc[N],jcn[N],n,k,ans;
int C(int x,int y){
	if(x<0||y<0||x<y)return 0;
	return 1ll*jc[x]*jcn[y]%mod*jcn[x-y]%mod;
}
int main(){
	inv[1]=jc[0]=jcn[0]=1;
	for(int i=2;i<N;++i)inv[i]=1ll*inv[mod%i]*(mod-mod/i)%mod;
	for(int i=1;i<N;++i)jc[i]=1ll*jc[i-1]*i%mod,jcn[i]=1ll*jcn[i-1]*inv[i]%mod;
	scanf("%d%d",&n,&k);
	for(int r=n,b=k-n;r<=k;++r,--b){
		int t=r-n+1;
		if(r>b)
			ans=(0ll+ans+C(k,r)+mod-C(k,r+t))%mod;
		else if(r==b)
			ans=(0ll+ans+C(k-1,r-1)+mod-C(k-1,r+t))%mod;
	}
	printf("%d\n",ans);
	return 0;
}
