#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "no-stack-protector")
using namespace std;
long long power(long long a, long long b);
long long powerwithmod(long long a, long long b);
long long fact[200005];
long long invfact[200005];
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  long long ans = fact[n];
  ans = (ans * invfact[r] + 998244353) % 998244353;
  ans = (ans * invfact[n - r] + 998244353) % 998244353;
  return ans;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long ans = 0;
  ans = ncr(m, n - 1);
  ans = ans * (n - 2);
  ans = (ans + 998244353) % 998244353;
  ans = ans * powerwithmod(2, n - 3);
  ans = (ans + 998244353) % 998244353;
  cout << ans << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  std::ifstream infile("soln.in");
  if (infile.good()) {
    assert(freopen("soln.in", "r", stdin));
    assert(freopen("soln.out", "w", stdout));
  }
  fact[0] = 1;
  for (long long i = 1; i <= 200002; i++) {
    fact[i] = (fact[i - 1] * i) % 998244353;
    fact[i] = (fact[i] + 998244353) % 998244353;
  }
  for (long long i = 0; i <= 200001; i++) {
    invfact[i] = powerwithmod(fact[i], 998244353 - 2);
  }
  long long test = 1;
  while (test--) solve();
  cerr << endl
       << "Time: " << (clock() * 1000. / CLOCKS_PER_SEC) << " ms" << endl;
  return 0;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long powerwithmod(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % 998244353;
    a = (a * a) % 998244353;
    b >>= 1;
  }
  return res % 998244353;
}
