#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353, K = 4e6 + 1;
int n, m;
long long f[K], inv[K], invf[K], x;
int mod_pow(int a, int k) {
  long long x = 1;
  for (int b = 30; 0 <= b; b--) {
    x = x * x % MOD;
    if (k & (1 << b)) x = x * a % MOD;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  f[0] = invf[0] = 1;
  for (int k = 1; k <= n + m; k++) f[k] = f[k - 1] * k % MOD;
  for (int k = 1; k <= max(n, m); k++) {
    inv[k] = mod_pow(k, MOD - 2);
    invf[k] = invf[k - 1] * inv[k] % MOD;
  }
  x = 0;
  for (int k = 1; k <= n + 1; k++)
    x = (x + k * f[n + m - k] % MOD * invf[n + 1 - k]) % MOD;
  x = x * f[n] % MOD * m % MOD * mod_pow(f[n + m], MOD - 2) % MOD;
  long long sol = 0, sum = 0;
  for (int k = n - 1; 0 <= k; k--) {
    sum += sol;
    if (sum >= MOD) sum -= MOD;
    sol = (f[m + n - k] * invf[n - k] % MOD * invf[m] % MOD * x + sum) % MOD;
    sol = sol * m % MOD * inv[n - k] % MOD;
  }
  sol =
      sol * f[m - 1] % MOD * f[n] % MOD * mod_pow(f[m + n - 1], MOD - 2) % MOD;
  cout << sol << "\n";
  return 0;
}
