#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

const int mod = 998244353;
const int mxn = 2022;
int n, m;
ll f[mxn][mxn];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> m;
	
	for(int i = 0; i <= m; i++) f[0][i] = 1;
	for(int i = 1; i <= n; i++){
		f[i][0] = 1;
		for(int j = 1; j <= m; j++) f[i][j] = (f[i - 1][j] + f[i][j - 1]) % mod;
	}
	
	/*
	Count number of ways to take chunks out of rectangle that look like this:
	
	#   |        ###
	####|      #####
	### |   ########  
	##  |###########
	#   |        ###
	
	One "hill" on each side touching split point. Combo using path up than down.
	*/
	
	ll ret = 0;
	for(int i = 1; i < n; i++)
	for(ll j = 1, x = 0; j <= m; j++){
		(ret += x * f[i - 1][j - 1] % mod * f[i][m - j]) %= mod;
		(x += f[n - i][j - 1] * f[n - i - 1][m - j]) %= mod;
	}
	
	for(int j = 1; j < m; j++)
	for(ll i = 2, x = 0; i < n; i++){
		(x += f[i - 2][j] * f[n + 1 - i][j - 1]) %= mod;
		(ret += x * f[i][m - j - 1] % mod * f[n - i - 1][m - j]) %= mod;
	}
	
	(ret *= 2) %= mod;
	
	cout << ret << endl;
	
	return 0;
}