#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
const int mod = 998244353;
int f[N], inv[N];
void init() {
  inv[0] = inv[1] = f[0] = f[1] = 1;
  for (int i = 2; i < N; i++) {
    f[i] = f[i - 1] * 1LL * i % mod;
    inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
  }
  for (int i = 2; i < N; i++) {
    inv[i] = 1LL * inv[i] * inv[i - 1] % mod;
  }
}
int c(int n, int m) {
  if (n < 0 || m < 0 || n < m) return 0;
  return 1LL * f[n] * inv[m] % mod * inv[n - m] % mod;
}
int qp(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res = 1LL * res * a % mod;
    }
    a = 1LL * a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  int n, m;
  init();
  scanf("%d%d", &n, &m);
  if (n == 2) {
    puts("0");
    return 0;
  }
  int res = 0;
  for (int i = 2; i <= m; i++) {
    res =
        (res + 1LL * c(i - 1, n - 2) * c(n - 2, 1) % mod * qp(2, n - 3) % mod) %
        mod;
  }
  printf("%d\n", res);
}
