#include #include using namespace std; using namespace atcoder; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count()); const ll MOD1000000007 = 1000000007; const ll MOD998244353 = 998244353; const ll MOD[3] = {999727999, 1070777777, 1000000007}; const ll LINF = 1LL << 60; const int IINF = 1 << 30; template struct Edge{ int to; T w; Edge(int to_, T w_=1){ to = to_; w=w_; } }; template using Tree = vector>>; template using Graph = vector>>; /* 容量&重み付きエッジ for Dinic */ template struct REdge{ int to; T cap; T cost; int rev; REdge(int to_, T cap_, T cost_=1){ to = to_; cap = cap_; cost = cost_; } REdge(int to_, T cap_, T cost_, int rev_){ to = to_; cap = cap_; cost = cost_; rev = rev_; } }; /* 残余グラフ for Dinic */ template using RGraph = vector>>; using mint = modint998244353; const ll MAX = 510000; mint fac[MAX], finv[MAX], inv[MAX]; void cominit(){ fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for(ll i=2; i> h >> w; h++; w++; //dp_h[i]:=合計i個の矢印でh-1に到達する組み合わせ //dp_w[i]:=合計i個の矢印でw-1に到達する組み合わせ vector dp_h(h, 0), dp_w(w, 0); for(ll n2=0; n2<=(h-1)/2; n2++){ ll n1 = (h-1)-n2*2; dp_h[n1+n2] = com(n1+n2, n1)*finv[n1+n2]; } for(ll n2=0; n2<=(w-1)/2; n2++){ ll n1 = (w-1)-n2*2; dp_w[n1+n2] = com(n1+n2, n1)*finv[n1+n2]; } vector a, b; for(ll i=h/2; i<=h-1; i++) a.pb(dp_h[i]); for(ll j=w/2; j<=w-1; j++) b.pb(dp_w[j]); vector c = convolution(a, b); mint ans = 0; for(ll i=h/2+w/2; i<=h+w-2; i++) ans += fac[i]*c[i-(h/2+w/2)]; cout << ans.val() << endl; }