def fft_inplace(a, w): n = len(a) m = n t = 1 while m >= 2: mh = m >> 1 for i in range(0, n, m): for s in range(mh): j, k = i+s, i+mh+s a[j], u = a[j]+a[k], a[j]-a[k] a[k] = u * w[s*t] % 998244353 m = mh t *= 2 def ifft_inplace(a, w): n = len(a) m = 2 t = -(n >> 1) while m <= n: mh = m >> 1 for i in range(0, n, m): for s in range(mh): j, k = i+s, i+mh+s u = a[k] * w[s*t] % 998244353 a[j], a[k] = a[j]+u, a[j]-u m <<= 1 t //= 2 n_inv = pow(n, 998244353-2, 998244353) for i in range(n): a[i] = a[i] * n_inv % 998244353 n, m = map(int, input().split()) assert 1 <= n <= 2000 assert 1 <= m <= 10 ** 9 fixed_n = 1 << ((n+1)*2).bit_length() w_root = pow(3, (998244353-1)//fixed_n, 998244353) w = [1] * fixed_n for i in range(1, fixed_n): w[i] = w[i-1] * w_root % 998244353 frac = [1] * (n + 1) for i in range(1, n+1): frac[i] = frac[i-1] * i % 998244353 frac_inv = [0] * (n+1) frac_inv[n] = pow(frac[n], 998244353-2, 998244353) for i in range(1, n+1)[::-1]: frac_inv[i-1] = frac_inv[i] * i % 998244353 dp1 = [0] * fixed_n dp1[0] = 1 t = [0] * fixed_n for i in range(n+1): t[i] = (pow(2, i, 998244353)-1) * pow(pow(2, i, 998244353) * frac[i], 998244353-2, 998244353) % 998244353 fft_inplace(t, w) ans_sub = [0] * (n+1) for k in range(min(n, m+1)): fft_inplace(dp1, w) for i, j in enumerate(t): dp1[i] = dp1[i] * j % 998244353 ifft_inplace(dp1, w) pow_tmp = 1 for i in range(k+1, n+1)[::-1]: ans_sub[i] += dp1[i] * pow_tmp % 998244353 pow_tmp = pow_tmp * (m - k) % 998244353 for i in range(n+1, fixed_n): dp1[i] = 0 ans = sum(ans_sub[i] % 998244353 * frac_inv[n-i] for i in range(n+1)) % 998244353 ans = ans * pow(2, n, 998244353) * frac[n] % 998244353 print(ans) try: x = input() assert x == "" except EOFError: pass