#include <bits/stdc++.h>
using LL = long long;
constexpr LL P = 998244353;
constexpr int maxn = 2000000;
LL invs[maxn * 2 + 1];
void setInvs(int maxval) {
  invs[1] = 1;
  for (int i = 2; i <= maxval; ++i) {
    const int k = (int(P) + i - 1) / i;
    invs[i] = k * invs[k * i - P] % P;
  }
  return;
}
LL inv(LL n) { return invs[n]; }
LL solve(int n, int m) {
  LL er = m + 1;
  LL epre = inv(m + 1);
  LL epost = m * inv(m + 1) % P;
  for (int i = 2; i <= n; ++i) {
    LL nr = (er + m * inv(i)) % P;
    LL pc = i * inv(i + m) % P;
    LL npre = pc * (1 + epre) % P;
    LL pMult = i * inv(i - 1) % P;
    LL npost = ((P + 1 - pc) * (1 + epre) + pMult * epost) % P;
    er = nr;
    epre = npre;
    epost = npost;
  }
  return (er + epre + epost) % P;
}
int main() {
  using namespace std;
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  setInvs(n + m);
  cout << solve(n, m) << '\n';
  return 0;
}
