#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair <int,int> Pii;
#define reg register
#define mp make_pair
#define pb push_back
#define Mod1(x) ((x>=P)&&(x-=P))
#define Mod2(x) ((x<0)&&(x+=P))
#define rep(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
template <class T> inline void cmin(T &a,T b){ ((a>b)&&(a=b)); }
template <class T> inline void cmax(T &a,T b){ ((a<b)&&(a=b)); }

char IO;
template <class T=int> T rd(){
	T s=0; int f=0;
	while(!isdigit(IO=getchar())) f|=IO=='-';
	do s=(s<<1)+(s<<3)+(IO^'0');
	while(isdigit(IO=getchar()));
	return f?-s:s;
}

const int N=2030,INF=1e9+10,P=998244353;

int n,m;
int dp[N][N],G[N][N],ans;
ll F(int n,int m){
	if(m<0) return 0;
	return m==0?1:(dp[n][m]-dp[n][m-1]+P)%P;
}
int S[N],T[N];

void Calc(){
	rep(i,1,n-1) {
		int s=0;
		rep(j,1,m-1) {
			s=(s+1ll*F(j,i)*dp[m-j][i-1])%P;
			ans=(ans+1ll*s*F(m-j,n-i)%P*dp[j][n-i-1])%P;
			//cout<<"$"<<i<<' '<<j<<' '<<1ll*s*F(m-j,n-i)%P*dp[j][n-i-1]%P<<endl;
		}
	}
	//cout<<ans<<endl;
}

int main(){
	dp[0][0]=1;
	rep(i,1,N-1){
		rep(j,0,N-1) {
			if(j) dp[i-1][j]+=dp[i-1][j-1],Mod1(dp[i-1][j]);
			dp[i][j]=dp[i-1][j];
		}
	}
	n=rd(),m=rd();
	//swap(n,m),Calc();
	Calc(),swap(n,m),Calc();
	rep(i,1,n-1) {
		int s=0;
		rep(j,1,m-1) {
			s=1ll*F(j,i)*dp[m-j][i-1]%P;
			ans=(ans-1ll*s*F(m-j,n-i)%P*dp[j][n-i-1])%P;
		}
	}
	Mod2(ans);
	//cout<<ans<<endl;
	printf("%d\n",ans*2%P);
}






				 	   	 	 	   	   		 				 		