#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
const int INF = 2e9;
const int MX = 200005;
const int MOD = 998244353;
const double PI = acos(-1.0);
long long fac[MX];
long long BigMod(long long n, long long p) {
  if (p == 1) return n;
  if (p == 0) return 1LL;
  long long temp = BigMod(n, p / 2) % MOD;
  temp = (temp * temp) % MOD;
  if (p & 1) temp = (temp * n) % MOD;
  return temp;
}
long long modInv(long long n) { return BigMod(n, MOD - 2); }
long long nCr(long long n, long long r) {
  if (r == 0) return 1;
  long long ret = fac[n];
  ret = (ret * modInv(fac[r])) % MOD;
  ret = (ret * modInv(fac[n - r])) % MOD;
  return ret;
}
int main() {
  fac[0] = 1;
  for (int i = 1; i < MX; i++) fac[i] = (fac[i - 1] * i) % MOD;
  int n = ({
    int a;
    read(a);
    a;
  }),
      m = ({
        int a;
        read(a);
        a;
      });
  if (n == 2) {
    printf("0\n");
    return 0;
  }
  long long res = nCr(m, n - 1);
  res = (res * (n - 2)) % MOD;
  res = (res * BigMod(2, n - 3)) % MOD;
  printf("%lld\n", res);
  return 0;
}
