#include<bits/stdc++.h>
using namespace std;
#define P 998244353
#define M 2505
int ans=0,n,m,sum1[M][M],sum2[M][M],fc[M<<1],inv[M<<1],g[M][M];
int C(int n,int m){
	return 1ll*fc[n]*inv[m]%P*inv[n-m]%P;
}
int solve(int n,int m,int p){
	int ans=0;
	for(int i=1;i<m;++i){
		for(int j=1;j<=n;++j)g[i][j]=1ll*sum1[j-1][i]*C(n-j+i-1,i-1)%P,sum2[i][j]=g[i][j];
		for(int j=1;j<=n;++j)sum2[i][j]=(sum2[i][j]+sum2[i][j-1])%P;
	}
	for(int l=1;l<m;++l)for(int i=1;i<n;++i)ans=(ans+1ll*g[l][i]*sum2[m-l][n-i-p])%P;
	return ans*2%P;
}
int main(){
	fc[0]=fc[1]=inv[0]=inv[1]=1;
	for(int i=2;i<(M<<1);++i)fc[i]=1ll*i*fc[i-1]%P;
	for(int i=2;i<(M<<1);++i)inv[i]=(P-1ll*P/i)*inv[P%i]%P;
	for(int i=2;i<(M<<1);++i)inv[i]=1ll*inv[i-1]*inv[i]%P;
	for(int i=0;i<M;++i){
		for(int j=1;j<M;++j)sum1[i][j]=C(i+j-1,j-1);
		if(i)for(int j=1;j<M;++j)sum1[i][j]=(sum1[i][j]+sum1[i-1][j])%P;
	}
	scanf("%d%d",&n,&m);
	ans=(ans+solve(n,m,0))%P;
	ans=(ans+solve(m,n,1))%P;
	printf("%d",ans);
} 