#include <bits/stdc++.h>
using namespace std;
int inf = 998244353;
int egcd(int a, int b, int& x, int& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  int x1, y1;
  int g = egcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return g;
}
int mod_inverse(int a, int m) {
  int x, y;
  int g = egcd(a, m, x, y);
  return g != 1 ? -1 : (x % m + m) % m;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long u = 1, u1 = 1, u2 = 1, c = 1;
  for (int i = 2; i <= m; i++) u = (u * (i % inf)) % inf;
  for (int i = 2; i <= n - 1; i++) u1 = (u1 * (i % inf)) % inf;
  for (int i = 2; i <= m - n + 1; i++) u2 = (u2 * (i % inf)) % inf;
  u2 *= u1;
  u2 %= inf;
  for (int i = 0; i < n - 3; i++) {
    c *= 2;
    c %= inf;
  }
  cout << u * mod_inverse(u2, inf) % inf * c % inf * (n - 2) % inf;
}
