MOD = 998244353 def main(): import sys N, M = map(int, sys.stdin.readline().split()) if M == 0: print(0) return max_m = M # Precompute factorials and inverse factorials max_fact = max(2*M, N) fact = [1]*(max_fact+1) inv_fact = [1]*(max_fact+1) for i in range(1, max_fact+1): fact[i] = fact[i-1] * i % MOD inv_fact[max_fact] = pow(fact[max_fact], MOD-2, MOD) for i in range(max_fact-1, -1, -1): inv_fact[i] = inv_fact[i+1] * (i+1) % MOD def comb(m, s): if s < 0 or s > m: return 0 return fact[m] * inv_fact[s] % MOD * inv_fact[m-s] % MOD total = 0 # Process m from 1 to M-1 for m in range(1, M): current = 0 x = 2 * M - 1 for s in range(0, m+1): c = comb(m, s) term = pow(x - s, N, MOD) if s % 2 == 1: term = (-term) % MOD current = (current + c * term) % MOD total = (total + m * current) % MOD # Process m = M m = M current = 0 x = 2 * M for s in range(0, m+1): c = comb(m, s) term = pow(x - s, N, MOD) if s % 2 == 1: term = (-term) % MOD current = (current + c * term) % MOD total = (total + m * current) % MOD print(total % MOD) if __name__ == '__main__': main()