#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const LL mod = 998244353;
const LL N = 400005;
LL fact[N], infact[N];
LL qmi(LL a, LL b) {
  LL res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
void init(LL t) {
  fact[0] = 1;
  for (LL i = 1; i <= t; ++i) fact[i] = fact[i - 1] * i % mod;
  infact[t] = qmi(fact[t], mod - 2);
  for (LL i = t - 1; ~i; --i) infact[i] = infact[i + 1] * (i + 1) % mod;
}
LL c(LL a, LL b) {
  if (a < b)
    return 0;
  else
    return fact[a] * infact[b] % mod * infact[a - b] % mod;
}
void add(LL& a, LL b) { a = (a + b) % mod; }
int main() {
  LL res = 0;
  LL n, m;
  scanf("%lld%lld", &n, &m);
  if (n == 2) {
    puts("0");
    return 0;
  }
  init(n + m);
  LL q = 0;
  for (LL j = 2; j <= n - 1; ++j) add(q, c(n - 3, j - 2));
  for (LL i = 1; i <= m; ++i) {
    LL f = c(i - 1, n - 2) * (n - 2) % mod;
    add(res, q * f % mod);
  }
  printf("%lld\n", res);
  return 0;
}
