#include <bits/stdc++.h>
using namespace std;
vector<long long> f(200001);
vector<long long> rv(200001);
long long binPow(long long a, long long n) {
  int res = 1;
  while (n) {
    if (n & 1) res = res * a % 998244353;
    a = a * a % 998244353;
    n >>= 1;
  }
  return res;
}
long long cnk(long long x, long long y) {
  if (x < y || y < 0) return 0;
  return f[x] * rv[y] % 998244353 * rv[x - y] % 998244353;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long ans = 0;
  if (n <= 2) {
    cout << ans;
    return 0;
  }
  f[0] = 1;
  rv[0] = 1;
  for (int i = 1; i < 200001; ++i) {
    f[i] = f[i - 1] * i % 998244353;
    rv[i] = binPow(f[i], 998244353 - 2);
  }
  ans = cnk(m, n - 1) * (n - 2) % 998244353 * binPow(2, n - 3) % 998244353;
  cout << ans;
}
