def cominit(n, mod): global fac, finv fac = [1] * n finv = [1] * n for i in range(2, n): fac[i] = (fac[i-1] * i) % mod finv[i] = (finv[i-1] * pow(i, mod-2, mod)) % mod def comb(n, k): global mod if n < k: return 0 if n < 0 or k < 0: return 0 return (fac[n] * finv[n-k] * finv[k]) % mod mod = 998244353 cominit(10**6, mod) n, m = map(int, input().split()) ans = 1 k = m for i in range(n-1): ans *= comb(k, m//n+(m%n>i)) ans %= mod k -= m // n + (m % n > i) print(ans)