#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 998244353;
long long n, m;
long long f[maxn];
long long inv[maxn];
long long pow(long long a, int b) {
  long long ans = 1, base = a;
  while (b > 0) {
    if (b % 2 == 1) ans = (base * ans) % mod;
    base = (base * base) % mod;
    b /= 2;
  }
  return ans;
}
long long c(long long n, long long m) {
  if (n == m) return 1;
  if (m == 0) return 1;
  return f[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  cin >> n >> m;
  f[0] = 1;
  for (int i = 1; i <= m; i++) {
    f[i] = f[i - 1] * i;
    f[i] %= mod;
    inv[i] = pow(f[i], mod - 2);
  }
  inv[0] = 1;
  long long ans = 0;
  long long c = 0;
  for (int i = 2; i < n; i++) {
    c += inv[i - 2] * inv[n - i - 1] % mod;
    c %= mod;
  }
  for (int h = n - 1; h <= m; h++) {
    ans += f[h - 1] * inv[h - n + 1] % mod * c % mod;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
