#include <bits/stdc++.h>
using namespace std;
const int N = 200043;
const long long int MOD = 998244353;
long long int binpow(long long int x, long long int y) {
  long long int z = 1;
  while (y) {
    if (y & 1ll) z = (z * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return z;
}
long long int fact[N];
void precalc() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (fact[i - 1] * i) % MOD;
}
int main() {
  int t;
  t = 1;
  precalc();
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    long long int ans = fact[m];
    if (n > 2) {
      long long int a = binpow(2ll, n - 3);
      a = (a * (n - 2)) % MOD;
      long long int b = (fact[m - n + 1] * fact[n - 1]) % MOD;
      b = binpow(b, MOD - 2);
      ans = (ans * b) % MOD;
      ans = (ans * a) % MOD;
      cout << ans << endl;
    } else
      cout << 0 << endl;
  }
}
