#include <bits/stdc++.h>
using namespace std;
const int MD = 998244353;
const int M = 2e5 + 100;
int n, m;
int p2[M], f[M], rf[M];
int C(int n, int k) {
  if (k < 0 || k > n) return 0;
  return (1ll * f[n] * rf[n - k]) % MD * rf[k] % MD;
}
int main() {
  p2[0] = 1, f[0] = 1;
  for (int i = 1; i < M; i++)
    p2[i] = (1ll * p2[i - 1] * 2) % MD, f[i] = (1ll * f[i - 1] * i) % MD;
  rf[M - 1] = 215470700;
  for (int i = M - 2; i >= 0; i--) rf[i] = (1ll * rf[i + 1] * (i + 1)) % MD;
  while (scanf("%d %d", &n, &m) == 2) {
    int res = 1ll * p2[n - 3] * C(m, n - 1) % MD * (n - 2) % MD;
    printf("%d\n", res);
  }
}
