#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX_N = 1e6 + 10;
const ll MOD = 998244353;

ll sq(ll x) { return x * x % MOD; }
ll qpow(ll a, ll b) { return b ? sq(qpow(a, b / 2)) * (b & 1 ? a : 1) % MOD : 1; }
ll inv(ll x) { return qpow(x, MOD - 2); }

int N, K;
ll fac[MAX_N], ifac[MAX_N];

ll comb(int n, int m) { return fac[n] * ifac[n - m] % MOD * ifac[m] % MOD; }
ll F(int n, int m) { return comb(n + m, n); }
ll G(int n, int m, int k) {
    if (k <= 0) return F(n, m);
    if (k > min(n, m)) return 0;
    return (F(n, m) + MOD - F(k - 1, n + m - (k - 1))) % MOD;
}

int main() {
    scanf("%d%d", &N, &K);
    fac[0] = 1;
    for (int i = 1; i < MAX_N; i++) fac[i] = fac[i - 1] * i % MOD;
    ifac[MAX_N - 1] = inv(fac[MAX_N - 1]);
    for (int i = MAX_N - 1; i; i--) ifac[i - 1] = ifac[i] * i % MOD;
    ll ans = 0;
    for (int i = 0; i <= K; i++) {
        if (i * 2 < K) continue;
        int blue = i, red = K - i;
        if (blue == red) {
            (ans += G(blue, red - 1, N - 1)) %= MOD;
        } else {
            (ans += G(blue, red, N - (blue - red))) %= MOD;
        }
    }
    printf("%lld\n", ans);
}
