#include <bits/stdc++.h>

const int mod = 998244353;
typedef long long LL;
void reduce(int & x) { x += x >> 31 & mod; }
int mul(int a, int b) { return (LL) a * b % mod; }
int fastpow(int a, int b, int res = 1) {
	for (; b; b >>= 1, a = mul(a, a)) if (b & 1) res = mul(res, a);
	return res;
}

const int MAXN = 1000010;
int fac[MAXN], inv[MAXN], n, K;
int C(int a, int b) { return (LL) fac[a] * inv[b] % mod * inv[a - b] % mod; }
int main() {
	fac[0] = fac[1] = inv[0] = inv[1] = 1;
	for (int i = 2; i != MAXN; ++i) {
		fac[i] = mul(fac[i - 1], i);
		inv[i] = mul(inv[mod % i], mod - mod / i);
	}
	for (int i = 2; i != MAXN; ++i)
		inv[i] = mul(inv[i - 1], inv[i]);
	std::cin >> K >> n;
	int ans = 0;
	for (int A = 0; A <= n; ++A) {
		int B = n - A;
		if (B >= K) {
			reduce(ans += C(n, A) - mod);
			if (A >= B - K + 1) {
				reduce(ans -= C(n, A - B + K - 1));
			}
		}
	}
	std::cout << ans << std::endl;
	return 0;
}
