## https://yukicoder.me/problems/no/2141 MOD = 998244353 def main(): N, M = map(int, input().split()) answer1 = 1 for i in range(1, M + 1): answer1 *= i answer1 %= MOD a1 = M // N a2 = M - a1 * N # a1 + 1個 a2個の箱に入れる.のこりのN - a2箱はa1個の箱に入れる answer2 = 1 for i in range(1, a1 + 1): answer2 *= i answer2 %= MOD answer3 = (answer2 * (a1 + 1)) % MOD if a2 == 0: answer4 = pow(answer2, M, MOD) else: answer4 = (pow(answer2, N - a2, MOD) * pow(answer3, a2, MOD)) % MOD answer = (answer1 * pow(answer4, MOD - 2, MOD)) % MOD print(answer) if __name__ == '__main__': main()