#include <bits/stdc++.h>
using namespace std;
int n, m;
long long fact[400000], ans;
long long modx(long long a) { return (a % 998244353 + 998244353) % 998244353; }
long long exp(long long a, int b) {
  if (b == 0) return 1;
  long long k = exp(a, b / 2);
  if (b % 2) return modx(modx(k * k) * a);
  return modx(k * k);
}
int main() {
  cin >> n >> m;
  fact[0] = 1;
  for (int i = 1; i < m; i++) fact[i] = modx(i * fact[i - 1]);
  for (int i = n - 1; i <= m; i++)
    ans = modx(ans + modx(modx(fact[i - 1] * exp(fact[n - 2], 998244353 - 2)) *
                          exp(fact[i - n + 1], 998244353 - 2)));
  ans = modx(modx(ans * exp(2, n - 3)) * (n - 2));
  cout << ans << endl;
}
