#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long MOD = 998244353;
long long fac[maxn], inv[maxn];
long long qpow(long long x, long long p) {
  long long ans = 1;
  while (p) {
    if (p & 1) {
      ans = (ans * x) % MOD;
    }
    x = (x * x) % MOD;
    p >>= 1;
  }
  return ans;
}
void pre(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = fac[i - 1] * i % MOD;
  }
  inv[n] = qpow(fac[n], MOD - 2);
  for (int i = n - 1; i >= 0; i--) {
    inv[i] = inv[i + 1] * (i + 1) % MOD;
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (n == 2) {
    printf("0\n");
    return 0;
  }
  pre(m);
  printf("%lld\n", fac[m] * inv[n - 1] % MOD * inv[m - n + 1] % MOD * (n - 2) %
                       MOD * qpow(1ll * 2, n - 3) % MOD % MOD);
  return 0;
}
