#include <bits/stdc++.h>
using namespace std;
const long long md = 998244353;
unsigned long long mulmod(unsigned long long a, unsigned long long b,
                          unsigned long long modulo) {
  a %= modulo;
  b %= modulo;
  if (a <= 0xFFFFFFF && b <= 0xFFFFFFF) return (a * b) % modulo;
  if (b > a) std::swap(a, b);
  unsigned long long result = 0;
  while (a > 0 && b > 0) {
    if (b & 1) {
      result += a;
      if (result >= modulo) result -= modulo;
    }
    a <<= 1;
    if (a >= modulo) a -= modulo;
    b >>= 1;
  }
  return result;
}
unsigned long long powmod(unsigned long long base, unsigned long long exponent,
                          unsigned long long modulo) {
  unsigned long long result = 1;
  while (exponent > 0) {
    if (exponent & 1) result = mulmod(result, base, modulo);
    base = mulmod(base, base, modulo);
    exponent >>= 1;
  }
  return result;
}
long long int modInverse(long long int n, long long int p) {
  return powmod(n, p - 2, p);
}
long long int nCrModPFermat(long int n, long int r, long int p) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long a = powmod(2, n - 3, md), b;
  a = mulmod(n - 2, a, md);
  b = nCrModPFermat(m, n - 1, md);
  a = mulmod(a, b, md);
  cout << a;
}
