#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long int mod = 998244353;
long long int pow2[200005];
long long int fac[200005];
long long int pwr(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
long long int modInverse(long long int n, long long int m) {
  return pwr(n, m - 2);
}
long long int cnk(long long int n, long long int k) {
  return (fac[n] * modInverse((fac[k] * fac[n - k]) % mod, mod)) % mod;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  pow2[0] = 1;
  fac[0] = 1;
  for (long long int k = 1; k < 200005; k++) {
    pow2[k] = (2ll * pow2[k - 1]) % mod;
    fac[k] = (k * fac[k - 1]) % mod;
  }
  long long int ans = 0;
  for (long long int k = n - 1; k <= m; k++) {
    long long int temp = (cnk(k - 2, n - 3) * pow2[n - 3]) % mod;
    ans += temp * (k - 1) % mod;
    ans %= mod;
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
