#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 7;
long long INF = 998244353;
long long Pow(long long x, long long y) {
  long long base = x;
  long long sum = 1;
  while (y) {
    if (y & 1) {
      sum = sum * base % INF;
    }
    y /= 2;
    base = base * base % INF;
  }
  return sum;
}
int main(int argc, char const *argv[]) {
  long long n, m;
  cin >> n >> m;
  int ans = n - 2;
  for (long long i = 1; i <= m; i++) ans = ans * i % INF;
  for (long long i = 1; i <= n - 1; i++) ans = ans * Pow(i, INF - 2) % INF;
  for (long long i = 1; i <= m - n + 1; i++) ans = ans * Pow(i, INF - 2) % INF;
  ans = (ans * Pow(2, n - 3)) % INF;
  cout << ans << endl;
  return 0;
}
