#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 400005;
const int mod = 998244353;
int n, m;
int fact[N], infact[N];
int qmi(int a, int k, int p) {
  int res = 1;
  while (k) {
    if (k & 1) res = (LL)res * a % p;
    a = (LL)a * a % p;
    k >>= 1;
  }
  return res;
}
int C(int a, int b) {
  return (LL)fact[a] * infact[a - b] % mod * infact[b] % mod;
}
int main() {
  scanf("%d%d", &n, &m);
  fact[0] = infact[0] = 1;
  for (int i = 1; i < N; ++i) {
    fact[i] = (LL)fact[i - 1] * i % mod;
    infact[i] = (LL)infact[i - 1] * qmi(i, mod - 2, mod) % mod;
  }
  if (n == 2) {
    printf("%d\n", 0);
    return 0;
  }
  int res = (LL)C(m, n - 1) * (n - 2) % mod;
  int p = qmi(2, n - 3, mod) % mod;
  printf("%d\n", (LL)res * p % mod);
  return 0;
}
