#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;

const int N=500005;
const int mod=998244353;

int n,k,ans;
int fac[N],inv[N];

int quickpow(int x,int y){
	int s=1;
	for (;y;y>>=1,x=1ll*x*x%mod)
		if (y&1) s=1ll*s*x%mod;
	return s;
}

void init(int n){
	int i;
	fac[0]=inv[0]=1;
	for (i=1;i<=n;i++) fac[i]=1ll*fac[i-1]*i%mod;
	inv[n]=quickpow(fac[n],mod-2);
	for (i=n-1;i;i--) inv[i]=1ll*inv[i+1]*(i+1)%mod;
}

int C(int x,int y){
	if (x<y) return 0;
	return 1ll*fac[x]*inv[y]%mod*inv[x-y]%mod;
}

int main(){
	int i;
	scanf("%d%d",&n,&k);
	init(k);
	for (i=n;i<=k;i++) (ans+=(C(k,k-i)-C(k,i+i-n+1))%mod)%=mod;
	ans=(ans%mod+mod)%mod;
	printf("%d\n",ans);
	return 0;
}