#include <bits/stdc++.h>
long long int power[200005];
long long int fact[200005];
long long int modInverse(long long int a, long long int m) {
  long long int m0 = m;
  long long int y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long int q = a / m;
    long long int t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long int C(long long int n, long long int k) {
  return (fact[n] *
          modInverse((fact[k] * fact[n - k]) % 998244353, 998244353)) %
         998244353;
}
using namespace std;
void solve() {
  long long int n, m;
  cin >> n >> m;
  long long int ans = 0;
  ans = ((C(m, n - 1) % 998244353 * (n - 2) % 998244353) % 998244353 *
         (n > 2 ? power[n - 3] : 0) % 998244353) %
        998244353;
  cout << ans << endl;
}
int main() {
  power[0] = 1;
  fact[0] = 1;
  for (int i = 1; i < 200005; i++) {
    power[i] = (2 * power[i - 1]) % 998244353,
    fact[i] = (i * fact[i - 1]) % 998244353;
  }
  solve();
}
