import numpy as np fft, ifft = np.fft.rfft, np.fft.irfft def convolve(f, g): fft_len = 1 while 2 * fft_len < len(f) + len(g) - 1: fft_len *= 2 fft_len *= 2 h = ifft(fft(f, fft_len, axis=0) @ fft(g, fft_len, axis=0), fft_len, axis=0) h = np.rint(h).astype(np.int64) return h[: len(f) + len(g) - 1] def convolution(f, g, p=998244353): f1, f2 = np.divmod(f, 1 << 15) g1, g2 = np.divmod(g, 1 << 15) a, c = convolve(f1, g1) % p, convolve(f2, g2) % p b = (convolve(f1 + f2, g1 + g2) - a - c) % p return ((a << 30) + (b << 15) + c) % p def poly_pow(f, n, p=998244353): res = np.eye(3, dtype=np.int64).reshape(1, 3, 3) while n: if n & 1: res = convolution(res, f, p) f = convolution(f, f, p) n >>= 1 return res def main(): mod = 998244353 P = np.array( [ [[499122177, 0, 0], [332748118, 0, 0], [0, 0, 0]], [[0, 499122177, 0], [0, 332748118, 332748118], [0, 665496236, 332748118]], ] ) v = np.array([[199648871, 0, 0], [0, 199648871, 598946612]]) N, H = map(int, input().split()) P = poly_pow(P, N - 1, mod) print(sum(np.sum(v[i] @ P[H - i :] % mod) for i in range(2)) % mod) if __name__ == "__main__": main()