#include <bits/stdc++.h>
using namespace std;
const int MAXINT = 1073741823;
const int MAXN = 200005;
const int MOD = 998244353;
uint64_t inverseModp(uint64_t a, uint64_t p) {
  uint64_t ex = p - 2, result = 1;
  while (ex > 0) {
    if (ex % 2 == 1) {
      result = (result * a) % p;
    }
    a = (a * a) % p;
    ex /= 2;
  }
  return result;
}
uint32_t c(uint32_t n, uint32_t r, uint32_t p) {
  if (r > n - r) r = n - r;
  if (r == 0) return 1;
  if (n / p - (n - r) / p > r / p) return 0;
  uint64_t result = 1;
  for (uint32_t i = n, x = 1; i > r; --i, ++x) {
    if (i % p != 0) {
      result *= i % p;
      result %= p;
    }
    if (x % p != 0) {
      result *= inverseModp(x % p, p);
      result %= p;
    }
  }
  return result;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m, answer = 1;
  cin >> n >> m;
  for (int i = 0; i < n - 3; i++) {
    answer *= 2;
    answer %= MOD;
  }
  answer *= c(m, n - 1, MOD);
  answer %= MOD;
  answer *= (n - 2);
  answer %= MOD;
  cout << answer;
  return 0;
}
