#include <bits/stdc++.h>
using namespace std;
void enable_io() {}
long long n, m;
const int N = 2e5;
long long mod = 998244353;
long long fact[N];
long long modexp(long long x, long long p) {
  long long ans = 1;
  while (p) {
    if (p & 1) {
      ans = (ans * x) % mod;
    }
    p >>= 1;
    x = (x * x) % mod;
  }
  return ans % mod;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  enable_io();
  cin >> n >> m;
  fact[0] = 1;
  for (int i = 0; i < m; ++i) {
    fact[i + 1] = (fact[i] * (i + 1)) % mod;
  }
  long long ans = 1;
  if (n < 3) {
    cout << 0 << endl;
    return 0;
  }
  ans = (ans * (n - 2)) % mod;
  ans = (ans * modexp(2, n - 3)) % mod;
  long long term = (fact[n - 1] * fact[m - n + 1]) % mod;
  long long inv = modexp(term, mod - 2);
  inv = (inv * fact[m]) % mod;
  ans = (ans * inv) % mod;
  cout << ans << endl;
  return 0;
}
