n = 10 ** 9 k = 2 * 10 ** 6 mod = 998244353 # def modinv(x): # xの逆元を求める際に[mod % x]の逆元が必要なので、関数の形でxの逆元を直接求めることは難しい。再帰を使えば行けそうだけど。 modinv_table = [-1] * (k+1) modinv_table[1] = 1 for i in range(2, k+1): modinv_table[i] = (-modinv_table[mod % i] * (mod // i)) % mod def binomial_coefficients(n, k): ans = 1 for i in range(k): ans *= n-i ans *= modinv_table[i + 1] ans %= mod return ans N, M = map(int, input().split()) tot = binomial_coefficients(pow(2, N, mod) - 1, M) res = (pow(2, N, mod) - 1) * binomial_coefficients(pow(2, N - 1, mod) - 1, M - 1) % mod if N < 30 and pow(2, N - 1) < M: print(tot) else: print((tot - res) % mod)