#include <bits/stdc++.h>
using namespace std;
void file() {}
const long long nax = 1e6 + 1, mod = 998244353;
vector<long long> fact(nax);
long long fast(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long ret;
  ret = fast(a, b / 2);
  if (b % 2) {
    ret *= ret;
    ret %= mod;
    ret *= a;
    ret %= mod;
  } else {
    ret *= ret;
    ret %= mod;
  }
  return ret;
}
long long nCr(long long n, long long r) {
  if (r > n) return 0;
  long long one = fact[n];
  long long two = fact[r];
  long long three = fact[n - r];
  long long four = (two * three) % mod;
  long long fourInv = fast(four, mod - 2);
  long long ret = (one * fourInv) % mod;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  file();
  int testCases = 1;
  fact[0] = 1;
  for (long long i = 1; i <= nax - 1; i++) {
    fact[i] = (i * fact[i - 1]) % mod;
  }
  while (testCases--) {
    long long n, m;
    cin >> n >> m;
    long long one = nCr(m, n - 1);
    long long ans = (one * (n - 2)) % mod;
    long long extra = fast(2, n - 3);
    ans *= extra;
    ans %= mod;
    cout << ans << "\n";
  }
  return 0;
}
