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

using namespace std;

const int mod = 998244353;
const int maxn = 500010;
typedef long long ll;

int N, K;
int jc[maxn], ijc[maxn], inv[maxn];

int C(int n, int m) {
    if (n < m) return 0;
 	return 1ll*jc[n]*ijc[m]%mod*ijc[n-m]%mod;   
}

int cal(int n, int m, int T) {
 	return ((C(n+m, n)-C(n+m,m-T-1))%mod+mod)%mod;   
}

int main() {
    scanf("%d%d", &N, &K);
   	inv[1] = 1; jc[0] = ijc[0] = jc[1] = ijc[1] = 1;
    for (int i = 2; i <= K; i++) {
     	inv[i] = mod-1ll*(mod/i)*inv[mod%i]%mod;
        jc[i] = 1ll*jc[i-1]*i%mod;
        ijc[i] = 1ll*ijc[i-1]*inv[i]%mod;
    }
    int ans = 0;
    for (int R = 0; R <= K; R++) {
        int B = K-R;
        if (R == B) {
            if (K >= 2*N) {
                ans = (ans + cal(R, B-1, (K-2*N)/2))%mod;
            }
        } else if (R > B) {
            if (R-B >= N) {
                ans = (ans + C(B+R, B))%mod;
            } else if (R >= N) {
             	ans = (ans + cal(R, B, R-N))%mod;   
            }
        }
    }
    printf("%d\n", ans);
    return 0;
}