#include <bits/stdc++.h>
using namespace std;
const int mxn = 200000;
long long int binpow(long long int a, long long int b, long long int mod) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    ans %= mod;
    a %= mod;
    b /= 2;
  }
  return ans;
}
long long int fact[mxn + 1];
void calcfac(long long int n, long long int mod) {
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
  }
}
long long int ncr(long long int p, long long int q, long long int mod) {
  long long int val = fact[p];
  long long int invfact = fact[q] * fact[p - q];
  val %= mod;
  invfact %= mod;
  val *= binpow(invfact, mod - 2, mod);
  val += mod;
  return val % mod;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int ans = 1;
  long long int mod = 998244353;
  calcfac(200000, mod);
  ans = (ans * (((long long int)binpow(2, n - 3, mod)) % mod)) % mod;
  ans = (ans * (n - 2)) % mod;
  ans = (ans * ncr(m, n - 1, mod)) % mod;
  cout << ans << '\n';
}
