#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
#pragma GCC optimize(2)
const double eps = 1e-10;
const int maxn = 2e5 + 10;
const long long mod = 998244353;
int sgn(double a) { return a < -eps ? -1 : a < eps ? 0 : 1; }
using namespace std;
long long da[maxn];
void init() {
  int i;
  da[0] = 1;
  da[1] = 1;
  for (i = 2; i < maxn; i++) da[i] = i * da[i - 1] % mod;
}
long long quickmod(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % mod;
      b--;
    }
    b /= 2;
    a = ((a % mod) * (a % mod)) % mod;
  }
  return ans;
}
long long C(long long a, long long b) {
  return (da[a] % mod) * (quickmod(da[b] * da[a - b] % mod, mod - 2)) % mod;
}
int main() {
  init();
  long long n, m;
  cin >> n >> m;
  if (n <= 2) {
    cout << 0 << endl;
    return 0;
  }
  cout << C(m, n - 1) * C(n - 2, 1) % mod * quickmod(2, n - 3) % mod << endl;
  return 0;
}
