#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int maxn = 2e5;
const int INF = 1e9;
const long long MOD = 998244353;
const int base = 31;
const int UP = 1e8;
long long n, m;
long long dp[maxn + 5];
struct EuclidReturn {
  long long u, v, d;
  EuclidReturn(long long _u, long long _v, long long _d) {
    u = _u;
    v = _v;
    d = _d;
  }
};
EuclidReturn Extended_Euclid(long long a, long long b) {
  if (b == 0) return EuclidReturn(1, 0, a);
  EuclidReturn aux = Extended_Euclid(b, a % b);
  long long v = aux.u - (a / b) * aux.v;
  return EuclidReturn(aux.v, v, aux.d);
}
long long modular_inverse(long long a) {
  EuclidReturn aux = Extended_Euclid(a, MOD);
  return ((aux.u / aux.d) % MOD + MOD) % MOD;
}
long long mulmod(long long a, long long b, long long c) {
  long long x = 0, y = a % c;
  while (b > 0) {
    if (b & 1) x = (x + y) % c;
    y = (y << 1) % c;
    b = b >> 1;
  }
  return x;
}
long long pow(long long a, long long b, long long c) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b & 1) x = mulmod(x, y, c);
    y = mulmod(y, y, c);
    b >>= 1;
  }
  return x;
}
void init() {}
void Time_Decreasing() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void enter() { scanf("%lld %lld", &n, &m); }
void solve() {
  if (n == 2) {
    printf("0");
    return;
  }
  dp[0] = 1;
  for (int i = 1; i <= m; i++) dp[i] = mulmod(dp[i - 1], i, MOD);
  long long res = dp[m];
  res = mulmod(res, modular_inverse(dp[m - n + 1]), MOD);
  res = mulmod(res, modular_inverse(dp[n - 1]), MOD);
  res = mulmod(res, n - 2, MOD);
  res = mulmod(res, pow(2, n - 3, MOD), MOD);
  printf("%lld", res);
}
int main() {
  init();
  Time_Decreasing();
  enter();
  solve();
}
