#include using namespace std; #define fi first #define se second #define pb push_back using vi = vector ; using ll = long long; using pii = pair ; const ll mod = 998244353; //~ const ll mod = 1e9 + 7; ll qpow(ll a, ll b, ll m = mod) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % m; t = t * t % m; } return r; } const int N = 1e6 + 11; ll inv[N], fac[N], ifac[N]; ll binom(int n, int m) { if(n < m || m < 0) return 0; // n >= 0 return fac[n] * ifac[m] % mod * ifac[n - m] % mod; } int main() { inv[1] = fac[0] = ifac[0] = 1; for(int i = 2; i < N; i ++) inv[i] = (mod - mod / i) * inv[mod % i] % mod; for(int i = 1; i < N; i ++) { fac[i] = i * fac[i - 1] % mod; ifac[i] = inv[i] * ifac[i - 1] % mod; } ios :: sync_with_stdio(false); int n, m; cin >> n >> m; ll ans = 0; for(int i = 0; i * n <= m; i ++) { ans += binom(m - i * n + i, i); ans %= mod; } if(n == 1) ans = 1; cout << ans << '\n'; }