#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } #include #include using namespace atcoder; using mint = modint998244353; int main() { fast_io(); int h, w; cin >> h >> w; int N = h + w; vector fact(N + 1), inv(N + 1); fact[0] = 1; for (int i = 1; i <= N; i++) fact[i] = fact[i - 1] * i; inv[N] = fact[N].inv(); for (int i = N; i >= 1; i--) inv[i - 1] = inv[i] * i; vector f(h + 1), g(w + 1); for (int i = 0; i <= h / 2; i++) { int j = h - 2 * i; f[i + j] = inv[i] * inv[j]; } for (int i = 0; i <= w / 2; i++) { int j = w - 2 * i; g[i + j] = inv[i] * inv[j]; } auto fg = convolution(f, g); mint ans = 0; for (int i = 0; i <= h + w; i++) { ans += fg[i] * fact[i]; } cout << ans.val() << endl; }