mod = 998244353 def comb(n, r): if n < r:return 0 if n < 0 or r < 0:return 0 return fa[n] * fi[r] % mod * fi[n - r] % mod n, m = map(int, input().split()) if n == 1: exit(print(1)) fa = [1] * (m + 1) fi = [1] * (m + 1) for i in range(1, m + 1): fa[i] = fa[i - 1] * i % mod fi[i] = pow(fa[i], -1, mod) ans = 0 for i in range(m // n + 1): ans += comb(m - i * (n - 1), i) ans %= mod print(ans % mod)