#include <bits/stdc++.h>
using namespace std;
const long long p = 998244353;
long long jc[200010], inv[200010];
long long qp(long long a, long long b, long long mod) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long getInv(long long x, long long p) { return qp(x, p - 2, p); }
long long getC(long long n, long long m, long long p) {
  return jc[n] * inv[m] % p * inv[n - m] % p;
}
long long n, m;
int main() {
  jc[0] = 1;
  inv[0] = 1;
  for (int j = 1; j <= 200005; j++) {
    jc[j] = jc[j - 1] * (long long)j % p;
    inv[j] = getInv(jc[j], p);
  }
  cin >> n >> m;
  if (n == 2) {
    puts("0");
    return 0;
  }
  long long tmp = 0;
  for (int i = 2; i <= n - 1; i++) {
    tmp += getC(n - 3ll, i - 2ll, p);
    tmp %= p;
  }
  printf("%lld\n", getC(m, n - 1, p) * (n - 2ll) % p * tmp % p);
  return 0;
}
