#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long mpow(long long a, long long b, long long p = MOD) {
  a = a % p;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % p;
    a = (a * a) % p;
    b = b >> 1;
  }
  return res % p;
}
const long long N = 2e5 + 5;
long long fac[N];
long long add(long long a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
long long sub(long long a, long long b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
long long mul(long long a, long long b) { return ((long long)a * b) % MOD; }
long long rev(long long a) { return mpow(a, MOD - 2); }
long long cal(long long n, long long r) {
  if (r > n) return 0;
  long long ans = fac[n];
  ans = mul(ans, rev(fac[r]));
  ans = mul(ans, rev(fac[n - r]));
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fac[0] = 1;
  for (long long i = 1; i < N; i++) fac[i] = (i * fac[i - 1]) % MOD;
  long long n, m;
  cin >> n >> m;
  long long ans = 0;
  long long oof = 0;
  for (long long i = 1; i <= n - 2; i++) {
    oof = add(oof, cal(n - 3, i - 1));
  }
  for (long long i = 1; i <= m; i++) {
    long long l = i - 1;
    if (l - n + 2 < 0) continue;
    long long ans1 = mul(fac[l], mul(rev(fac[n - 3]), rev(fac[l - n + 2])));
    ans = add(ans, mul(ans1, oof));
  }
  cout << ans;
}
