#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5005;
const long long int MOD = 998244353;
long long int postsum[MAXN], fact[MAXN], inv_fact[MAXN];
long long int power(long long int a, long long int b)
{
	if (b == 0)
	{
		return 1;
	}
	long long int ans = power(a, b/2);
	ans = (ans * ans) % MOD;
	if (b%2)
	{
		ans = (ans * a) % MOD;
	}
	return ans;
}
void precompute()
{
	fact[0] = 1;
	for (int i = 1; i < MAXN; ++i)
	{
		fact[i] = (fact[i - 1] * i) % MOD;
	}

	inv_fact[MAXN - 1] = power(fact[MAXN - 1], MOD - 2);
	for (int i = MAXN - 2; i >= 0; --i)
	{
		inv_fact[i] = (inv_fact[i + 1] * (i + 1)) % MOD;
	}
}
long long int comb(int n, int r)
{
	// cerr<<n<<"\t"<<r<<":\t";
	if (r > n)
	{
		// cerr<<0<<"\n";
		return 0;
	}
	// cerr<<((((fact[n] * inv_fact[r]) % MOD) * inv_fact[n - r]) % MOD)<<"\n";
	return ((((fact[n] * inv_fact[r]) % MOD) * inv_fact[n - r]) % MOD);
}
long long int f(int n, int m, int diff)
{
	long long int ans = 0;
	for (int div_col = 1; div_col < m; ++div_col)
	{
		for (int i = 0; i < MAXN; ++i)
		{
			postsum[i] = 0;
		}
		for (int i = n - 1; i >= 0; --i)
		{
			long long int temp = comb(m - (div_col + 1) + i, i) * comb(m - div_col + n - (i + 1), n - (i + 1));
			postsum[i] = (postsum[i + 1] + temp) % MOD;
		}
		for (int i = 0; i < n; ++i)
		{
			long long int temp = comb(i + div_col, div_col) * comb(n - (i + 1) + div_col - 1, div_col - 1);
			temp %= MOD;
			ans = (ans + temp * postsum[i + 1 + diff]) % MOD;
		}
	}
	return ans;
}
int main()
{
	precompute();
	int n, m;
	cin>>n>>m;

	long long int ans = f(n, m, 0) + f(m, n, 1);
	cout<<(ans * 2) % MOD<<"\n";
	return 0;
}