#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const int maxn = 4e5 + 10;
const int mod = 998244353;
long long fac[maxn], inv[maxn];
template <typename T = int>
inline const T read() {
  T x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long qpow(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) res = res * x % mod;
    x = x * x % mod;
    k >>= 1;
  }
  return res;
}
long long com(int a, int b) {
  if (a < b) return 0;
  return fac[a] * inv[b] % mod * inv[a - b] % mod;
}
int main() {
  int n = read(), m = read();
  long long x = 0, y = 0, res = 0;
  fac[0] = 1;
  if (n == 2)
    cout << 0 << endl;
  else {
    for (int i = 1; i <= n + m; i++) fac[i] = fac[i - 1] * i % mod;
    inv[n + m] = qpow(fac[n + m], mod - 2);
    for (int i = n + m - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
    for (int i = 2; i < n; i++) x = (x + com(n - 3, i - 2)) % mod;
    for (int i = 1; i <= m; i++) {
      y = com(i - 1, n - 2) * (n - 2) % mod;
      res = (res + x * y % mod) % mod;
    }
    write(res);
  }
  return 0;
}
