""" AA_DELETE_BB 想定解v1 """ import sys from sys import stdin def modfac(n, MOD): f = 1 factorials = [1] for m in range(1, n + 1): f *= m f %= MOD factorials.append(f) inv = pow(f, MOD - 2, MOD) invs = [1] * (n + 1) invs[n] = inv for m in range(n, 1, -1): inv *= m inv %= MOD invs[m - 1] = inv return factorials, invs def modnCr(n,r): return fac[n] * inv[n-r] * inv[r] % mod x,y = map(int,stdin.readline().split()) mod = 998244353 fac,inv = modfac(x+y+10,mod) #制約チェック assert 1 <= x <= 4000 assert 1 <= y <= 4000 bpow = [1] for i in range(x+y+10): bpow.append(bpow[-1] * 2 % mod) ans = 0 for P in range(min(x,y) + 1): qmax = min(x,y) - P for Q in range(qmax+1): ans += bpow[Q] * modnCr(x+y-2*P-Q,Q) * modnCr(x+y-2*P-2*Q,x-P-Q) ans %= mod print (ans % mod)