#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long q_pow(long long y, long long x) {
  if (x == 0) return 1;
  long long base = y;
  long long res = 1;
  while (x) {
    if (x & 1) {
      res = res * base % mod;
    }
    base = base * base % mod;
    x >>= 1;
  }
  return res % mod;
}
long long inv(long long x) { return q_pow(x, mod - 2); }
long long C(long long x, long long y) {
  long long yy = y + 1;
  long long res = 1;
  y = x - y;
  while (yy <= x) {
    res = res * yy % mod;
    yy++;
  }
  while (y >= 1) {
    res = res * inv(y) % mod;
    y--;
  }
  return res % mod;
}
long long n, m, ans = 1;
int main() {
  cin >> n >> m;
  if (n == 2) {
    cout << 0 << endl;
    return 0;
  }
  long long ans;
  ans = ((C(m, n - 1) * (n - 2)) % mod) * q_pow(2, n - 3) % mod;
  cout << ans << endl;
  return 0;
}
