#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#define N 998244353
#define LL long long int
int n,m;
using namespace std;
LL dp[][];
LL dfs(int he,int qiu,int lim)
{
// if(n%m!=0&&lim==n/m+1)
// return 0;
if(he==)
{
if(qiu!=)
return ;
else
return ;
}
if(dp[he][qiu]) return dp[he][qiu];
LL rec=;
for(int i=;i<=qiu&&i<lim;i++)
rec+=dfs(he-,qiu-i,lim),rec%=N;
dp[he][qiu]=rec;
return rec;
}
int main()
{
cin.sync_with_stdio(false);
cin>>n>>m;
LL ans=;
for(int i=n;i>=;i--)
{
memset(dp,,sizeof(dp));
ans+=dfs(m-,n-i,i),ans%=N;
}
cout<<ans*m%N<<endl;
return ;
}