#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int N = 2e5;
int fact[N];
void precalc() {
  fact[0] = 1;
  for (int i = 1; i <= N; ++i) {
    fact[i] = (fact[i - 1] * 1LL * i) % MOD;
  }
}
int binpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b % 2 == 1) {
      res = (res * 1LL * a) % MOD;
      --b;
    } else {
      a = (a * 1LL * a) % MOD;
      b /= 2;
    }
  }
  return res;
}
int C(int n, int k) {
  int x = (fact[k] * 1LL * fact[n - k]) % MOD;
  return (fact[n] * 1LL * binpow(x, MOD - 2)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  precalc();
  int n, m;
  cin >> n >> m;
  int res = 0;
  if (n > 2) {
    res = (C(m, n - 1) * 1LL * (n - 2)) % MOD * 1LL * binpow(2, n - 3) % MOD;
  }
  cout << res;
  return 0;
}
