#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
const int MOD = 998244353;
long long fac[N];
long long step(long long x, long long y) {
  if (y == 0) return 1;
  if (y % 2 == 1) return (x * 1ll * step(x, y - 1)) % MOD;
  long long p = step(x, y / 2);
  return (p * 1ll * p) % MOD;
}
long long cnk(int n, int k) {
  long long p = fac[n];
  p = (p * 1ll * step(fac[k], MOD - 2)) % MOD;
  p = (p * 1ll * step(fac[n - k], MOD - 2)) % MOD;
  return p;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 2) {
    cout << 0;
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= m; i++) fac[i] = (fac[i - 1] * 1ll * i) % MOD;
  long long ans = 0;
  for (int i = 1; i < m; i++) {
    long long c = cnk(m - 1, n - 2);
    if (i - 1 >= n - 2) c -= cnk(i - 1, n - 2);
    ans = (ans + c + MOD) % MOD;
  }
  n -= 2;
  long long p = (step(2, n - 1)) % MOD;
  ans = (ans * 1ll * p) % MOD;
  cout << ans;
}
