#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>

inline int read() {
	int x = 0, f = 1; char ch = getchar();
	while(ch > '9' || ch < '0') { if(ch == '-') f = -1; ch = getchar(); }
	do x = x * 10 + ch - 48, ch = getchar(); while(ch >= '0' && ch <= '9');
	return x * f;
}

typedef long long ll;
const int MAXN = 500001;
const int p = 998244353;

int n,k;
ll fac[MAXN],ifac[MAXN];

ll C(int n,int m) {
	if(n < m) return 0;
	if(m < 0 || n < 0) return 0;
	return fac[n] * ifac[m] % p * ifac[n - m] % p;
}

int main() {
	n = read(), k = read();
	if(k < n) return std::puts("0"), 0;
	fac[0] = 1;
	for(int i = 1;i <= k;i++) fac[i] = fac[i - 1] * i % p;
	ifac[0] = ifac[1] = 1;
	for(int i = 2;i <= k;i++) ifac[i] = (p - p / i) * ifac[p % i] % p;
	for(int i = 1;i <= k;i++) ifac[i] = ifac[i - 1] * ifac[i] % p; 
	ll ans = 0;
	for(int r = (k - 1) / 2 + 1;r <= k;r++) {
		int b = k - r;
		if(r == b) b--;
		ans = ((ans + C(r + b,b)) % p + p - C(r + b,2 * r - n + 1)) % p;
	}
	std::printf("%lld\n",ans);
	return 0;
}
