#include<bits/stdc++.h>
#define intt long long 
using namespace std;
const int maxx = 2e6+1314;
const int M = 998244353;
intt read(){intt k;cin>>k;return k;}
intt n,k,Ans=0;
intt qsm(intt x){
	if(x==0)return 1;	
	intt s=x,ans=1;
	int k=M-2;
	while(k){
		if(k&1)ans=ans*s%M;
		k>>=1;s=s*s%M;
	}	
	return ans;
}	
intt ans=0;
intt times[maxx];
intt inv[maxx];
void pre(){	
	times[0]=1;
	for(int i=1;i<=maxx-2;i++)times[i]=times[i-1]*i%M;
}	
intt C(int a,int b){
if(b<0)return 0;
return times[a]*qsm(times[a-b])%M*qsm(times[b])%M;}
intt work1(int x,int y){
	ans+= C(x+y-1,y-1)-C(x+y-1,y-1-(x-n+1));
	ans%=M;
}	
intt work2(int x,int y){
	ans+=C(x+y,y)-C(x+y,y-(x-n+1));
	ans%=M;
}	
int main(){	
	pre();
	n=read();k=read();
	for(int i=n;i<=k;i++){	
		int x=i,y=k-i;
		if(x<y)continue;
		if(x==y)work1(x,y);
		else work2(x,y);
	}	
	cout<<ans<<endl;
	return 0;	
}	
	
	