#include <bits/stdc++.h>
using namespace std;
long double eps = (long double)1 / 1e15;
long long inf = 1e18, mod2 = 998244353, mod1 = 1e9 + 7;
long long sqr(long long a) { return a * a; }
long long qb(long long a) { return a * a * a; }
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
long long binpow(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod
                    : sqr(binpow(a, b / 2, mod)) % mod)
           : 1;
}
long long fact[200001];
int main() {
  cout.tie(0), cin.tie(0), ios_base::sync_with_stdio(0);
  long long n, m, i, t, ans = 1;
  cin >> n >> m;
  fact[1] = 1;
  for (i = 2; i <= m; i++) fact[i] = i * fact[i - 1], fact[i] %= mod2;
  for (i = n; i <= m; i++) ans *= i, ans %= mod2;
  t = binpow(fact[m - n + 1], mod2 - 2, mod2);
  ans *= t, ans %= mod2;
  ans *= (n - 2), ans %= mod2;
  ans *= binpow(2, n - 3, mod2), ans %= mod2;
  cout << ans;
  return 0;
}
