def main(): from sys import stdin, setrecursionlimit # setrecursionlimit(1000000) input = stdin.readline def iinput(): return int(input()) def sinput(): return input().rstrip() def i0input(): return int(input()) - 1 def linput(): return list(input().split()) def liinput(): return list(map(int, input().split())) def miinput(): return map(int, input().split()) def li0input(): return list(map(lambda x: int(x) - 1, input().split())) def mi0input(): return map(lambda x: int(x) - 1, input().split()) INF = 1000000000000000000 MOD = 998244353 def modinv(a): b = MOD u, v = 1, 0 while b > 0: t = a // b a -= t * b a, b = b, a u -= t * v u, v = v, u return u % MOD class Combination: def __init__(self, N, MOD): self.factorial = [1] self.inv_factorial = [1] self.mod = MOD for i in range(1, N+1): self.factorial.append(self.factorial[-1] * i % MOD) self.inv_factorial.append(self.inv_factorial[-1] * modinv(i) % MOD) def combi(self, n, k): return self.factorial[n] * self.inv_factorial[k] % self.mod * self.inv_factorial[n-k] % self.mod cmb = Combination(404040, MOD) def counter(N): ans = dict() for k in range((N+1)//2, N+1): ans[k] = cmb.combi(k, N-k) return ans H, W = miinput() def solve_naive(H, W): ans = 0 for h in range((H+1)//2, H+1): for w in range((W+1)//2, W+1): ans += cmb.factorial[h+w] * cmb.inv_factorial[H-h] % MOD * cmb.inv_factorial[2*h-H] % MOD * cmb.inv_factorial[W-w] % MOD * cmb.inv_factorial[2*w-W] % MOD ans %= MOD return ans def solve(H, W): fft = FFT(MOD) ans = 0 Wlist = [] for w in range((W+1)//2, W+1): Wlist.append(cmb.inv_factorial[W-w] * cmb.inv_factorial[2*w-W] % MOD) HWlist = [] for hw in range((H+1)//2 + (W+1)//2, H+W+1): HWlist.append(cmb.factorial[hw]) Sum = fft.convolution(Wlist[::-1], HWlist) for i, h in enumerate(range((H+1)//2, H+1)): ans += Sum[i+len(Wlist)-1] % MOD * cmb.inv_factorial[H-h] % MOD * cmb.inv_factorial[2*h-H] % MOD ans %= MOD return ans # print(solve_naive(H, W)) print(solve(H, W)) class FFT(): def primitive_root_constexpr(self,m): if m==2:return 1 if m==167772161:return 3 if m==469762049:return 3 if m==754974721:return 11 if m==998244353:return 3 divs=[0]*20 divs[0]=2 cnt=1 x=(m-1)//2 while(x%2==0):x//=2 i=3 while(i*i<=x): if (x%i==0): divs[cnt]=i cnt+=1 while(x%i==0): x//=i i+=2 if x>1: divs[cnt]=x cnt+=1 g=2 while(1): ok=True for i in range(cnt): if pow(g,(m-1)//divs[i],m)==1: ok=False break if ok: return g g+=1 def bsf(self,x): res=0 while(x%2==0): res+=1 x//=2 return res butterfly_first=True butterfly_inv_first=True sum_e=[0]*30 sum_ie=[0]*30 def __init__(self,MOD): self.mod=MOD self.g=self.primitive_root_constexpr(self.mod) def butterfly(self,a): n=len(a) h=(n-1).bit_length() if self.butterfly_first: self.butterfly_first=False es=[0]*30 ies=[0]*30 cnt2=self.bsf(self.mod-1) e=pow(self.g,(self.mod-1)>>cnt2,self.mod) ie=pow(e,self.mod-2,self.mod) for i in range(cnt2,1,-1): es[i-2]=e ies[i-2]=ie e=(e*e)%self.mod ie=(ie*ie)%self.mod now=1 for i in range(cnt2-2): self.sum_e[i]=((es[i]*now)%self.mod) now*=ies[i] now%=self.mod for ph in range(1,h+1): w=1<<(ph-1) p=1<<(h-ph) now=1 for s in range(w): offset=s<<(h-ph+1) for i in range(p): l=a[i+offset] r=a[i+offset+p]*now r%=self.mod a[i+offset]=l+r a[i+offset]%=self.mod a[i+offset+p]=l-r a[i+offset+p]%=self.mod now*=self.sum_e[(~s & -~s).bit_length()-1] now%=self.mod def butterfly_inv(self,a): n=len(a) h=(n-1).bit_length() if self.butterfly_inv_first: self.butterfly_inv_first=False es=[0]*30 ies=[0]*30 cnt2=self.bsf(self.mod-1) e=pow(self.g,(self.mod-1)>>cnt2,self.mod) ie=pow(e,self.mod-2,self.mod) for i in range(cnt2,1,-1): es[i-2]=e ies[i-2]=ie e=(e*e)%self.mod ie=(ie*ie)%self.mod now=1 for i in range(cnt2-2): self.sum_ie[i]=((ies[i]*now)%self.mod) now*=es[i] now%=self.mod for ph in range(h,0,-1): w=1<<(ph-1) p=1<<(h-ph) inow=1 for s in range(w): offset=s<<(h-ph+1) for i in range(p): l=a[i+offset] r=a[i+offset+p] a[i+offset]=l+r a[i+offset]%=self.mod a[i+offset+p]=(l-r)*inow a[i+offset+p]%=self.mod inow*=self.sum_ie[(~s & -~s).bit_length()-1] inow%=self.mod def convolution(self,a,b): n=len(a);m=len(b) if not(a) or not(b): return [] if min(n,m)<=40: if n