#include #include using namespace std; const long long MOD = 998244353; template struct Combination { long long n_max; vector fac, inv, finv; Combination(int n):n_max(n), fac(n+1,1), inv(n+1,1), finv(n+1,1){ for(int i = 2; n > i; i++){ fac[i] = (fac[i-1]*i)%mod; inv[i] = mod-((inv[mod%i]*(mod/i))%mod); finv[i] = (finv[i-1]*inv[i])%mod; } } long long C(int n, int r){ if(n < r)return 0; if(max(n,r) > n_max)return 0; return (((fac[n]*finv[r])%mod)*finv[n-r])%mod; } }; using comb = Combination; int main(){ int n,m;cin>>n>>m; if(n > m)cout << 1 << endl; else{ int x = m/n; comb c(m); long long ans = 0; for(int i = 0; x >= i; i++){ ans = (ans+c.C(m-(i*(n-1)), i))%MOD; } cout << ans << endl; } }