#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const long long mod = 998244353;
long long bigMod(long long n, long long p) {
  if (p == 0) return 1;
  if (p == 1) return n;
  if (p % 2 == 0) {
    long long ret = bigMod(n, p / 2);
    return ret * ret % mod;
  }
  return n * bigMod(n, p - 1) % mod;
}
long long f[N], inv[N];
long long nCr(long long n, long long r) {
  return f[n] * inv[r] % mod * inv[n - r] % mod;
}
int main() {
  int T;
  long long n, m;
  f[0] = 1;
  for (int i = 1; i < N; i++) {
    f[i] = (f[i - 1] * i) % mod;
  }
  for (int i = 0; i < N; i++) {
    inv[i] = bigMod(f[i], mod - 2) % mod;
  }
  cin >> n >> m;
  long long res = 0;
  if (n == 2)
    printf("0\n");
  else {
    res = nCr(m, n - 1) * (n - 2) % mod * bigMod(2, n - 3) % mod;
    printf("%lld\n", res);
  }
  return 0;
}
