#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10, pi = 3.1415926535898;
const int mod = 998244353, maxn = 2e5 + 10;
int T, n, m, k, x, y, a[maxn], p, b;
long long fac[maxn] = {1, 1}, inv[maxn] = {1, 1}, inv_fac[maxn] = {1, 1};
char st[maxn];
void init() {
  for (int i = 2; i < maxn; ++i) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
    inv_fac[i] = inv_fac[i - 1] * inv[i] % mod;
  }
}
long long C(long long n, long long m) {
  if (m < 0 || n < 0 || n < m) return 0;
  return fac[n] * inv_fac[n - m] % mod * inv_fac[m] % mod;
}
int main(int argc, char const *argv[]) {
  init();
  scanf("%d %d", &n, &m);
  if (n == 2) {
    printf("0\n");
    return 0;
  }
  long long ans = 0, cnt = 0;
  for (int i = n - 2; i <= m - 1; ++i) {
    cnt += C(i, n - 2);
  }
  cnt %= mod;
  for (int i = 2; i <= n - 1; ++i) {
    long long cc = cnt;
    cc = cc * C(n - 3, i - 2) % mod * (n - 2) % mod;
    ans += cc;
  }
  cout << ans % mod << endl;
  ;
  return 0;
}
