n, m = map(int, input().split()) if n > m or n == 1: print(1) exit() mod = 998244353 fact = [1] * (m + 1) inv = [1] * (m + 1) finv = [1] * (m + 1) for i in range(2, m + 1): fact[i] = fact[i - 1] * i % mod inv[i] = mod - inv[mod % i] * (mod // i) % mod finv[i] = finv[i - 1] * inv[i] % mod def comb(x, y): return fact[x] * finv[y] % mod * finv[x - y] % mod q = m // n ans = 0 for i in range(q + 1): p = m - n * i ans += comb(i + p, i) ans %= mod print(ans)