#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const long long int MOD = 998244353;
const long long int N = 2e5 + 5;
const long long int INF = 1000111000111000111LL;
const long double PI = 3.1415926535898;
long long int mod_exp(long long int base, long long int exp,
                      long long int mod) {
  long long int ans = 1;
  while (exp) {
    if (exp % 2) ans = (ans % mod * base % mod) % mod;
    base = (base % mod * base % mod) % mod;
    exp /= 2;
    ans %= mod;
  }
  return ans;
}
long long int inv_mod(long long int base, long long int mod) {
  return mod_exp(base, mod - 2, mod);
}
long long int fact[N];
void pre_compute() {
  fact[0] = 1;
  for (long long int i = 1; i < N; i++) {
    fact[i] = i * fact[i - 1];
    fact[i] %= MOD;
  }
}
long long int nCr(long long int n, long long int r) {
  if (r >= n or r == 0) return 1;
  return ((fact[n] % MOD * inv_mod(fact[r], MOD) % MOD) *
          inv_mod(fact[n - r], MOD)) %
         MOD;
}
int32_t main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  pre_compute();
  long long int n, m;
  cin >> n >> m;
  long long int ans = nCr(m, n - 1);
  ans *= mod_exp(2, n - 3, MOD);
  ans %= MOD;
  ans *= (n - 2);
  ans %= MOD;
  cout << ans;
  return 0;
}
