h,w=map(int,input().split()) M=998244353 fa=[1,1] fb=[1,1] for i in range(2,h+w+1): fa+=[fa[-1]*i%M] fb+=[fb[-1]*(M//i)*fb[M%i]*fa[M%i-1]*(-1)%M] ans=0 for i in range(1,min(h-1,w-1)+1): ans+=pow(2,h*w-(h+w-1)-(2*i-1),M)*fa[h-1-1]*fb[i-1]*fb[h-1-1-(i-1)]*fa[w-1]*fb[i]*fb[w-1-i] ans%=M for i in range(1,min(h-1,w)+1): ans+=pow(2,h*w-(h+w-1)-(2*i-2),M)*fa[h-1-1]*fb[i-1]*fb[h-1-1-(i-1)]*fa[w-1]*fb[i-1]*fb[w-1-(i-1)] ans%=M print(ans)