#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
inline int read() {
  int ret = 0, sgn = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') sgn = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * sgn;
}
inline void Out(int a) {
  if (a > 9) Out(a / 10);
  putchar(a % 10 + '0');
}
long long __gcd(long long a, long long b) {
  return b == 0 ? a : __gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / __gcd(a, b); }
const int MOD = 998244353;
const int N = 2e5 + 7;
long long n, m, ans, sum, fac[N << 1], invfac[N << 1];
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % MOD;
    a = 1ll * a * a % MOD;
    b >>= 1;
  }
  return res % MOD;
}
void init(int M) {
  fac[0] = 1;
  for (int i = 1; i <= M; i++) fac[i] = 1ll * fac[i - 1] * i % MOD;
  invfac[M] = qpow(fac[M], MOD - 2);
  for (int i = M - 1; ~i; i--) invfac[i] = 1ll * invfac[i + 1] * (i + 1) % MOD;
}
int C(int x, int y) {
  return x < y ? 0 : 1ll * fac[x] * invfac[y] % MOD * invfac[x - y] % MOD;
}
int main() {
  scanf("%d%d", &n, &m);
  if (n == 2) {
    puts("0");
    return 0;
  }
  init(n + m);
  sum = 0;
  for (int j = 2; j <= n - 1; j++) {
    sum = (sum + C(n - 3, j - 2)) % MOD;
  }
  for (int i = 1; i <= m; i++) {
    int now = C(i - 1, n - 2) * (n - 2) % MOD;
    ans = (ans + sum * now % MOD) % MOD;
  }
  printf("%d\n", ans);
  return 0;
}
