#include <bits/stdc++.h>
using namespace std;
const int N = 200043;
const int MOD = 998244353;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int add(long long int x, long long int y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
  return x;
}
long long int mul(long long int x, long long int y) {
  return (x * 1ll * y) % MOD;
}
long long int binpow(long long int x, long long int y) {
  long long int z = 1;
  while (y) {
    if (y & 1) {
      z = mul(z, x);
    }
    x = mul(x, x);
    y >>= 1;
  }
  return z;
}
long long int inv(long long int x) { return binpow(x, MOD - 2); }
long long int divide(long long int x, long long int y) {
  return mul(x, inv(y));
}
long long int fact[N];
void precalc() {
  fact[0] = 1;
  for (long long int i = 1; i < N; i++) {
    fact[i] = mul(fact[i - 1], i);
  }
}
long long int C(long long int n, long long int k) {
  return divide(fact[n], mul(fact[k], fact[n - k]));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int tc;
  tc = 1;
  while (tc--) {
    precalc();
    long long int n, m;
    cin >> n >> m;
    if (n > 2) {
      long long int selection_of_set = C(m, n - 1);
      long long int values_that_can_have_same_pair = n - 2;
      long long int partial_answer =
          ((selection_of_set % MOD) * (values_that_can_have_same_pair) % MOD) %
          MOD;
      long long int values_that_can_be_on_either_side = n - 3;
      long long int ways = binpow(2, values_that_can_be_on_either_side);
      long long int ans = ((ways % MOD) * (partial_answer % MOD)) % MOD;
      cout << ans << endl;
    } else {
      cout << 0 << endl;
    }
  }
  return 0;
}
