#include <bits/stdc++.h>
using namespace std;
const int N = 2e5, M = 998244353;
int n, m;
long long iv[N + 1];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  iv[1] = 1;
  for (int i = 2; i <= N; ++i) {
    iv[i] = (M - M / i * iv[M % i] % M) % M;
  }
  long long ans = 1;
  for (int i = 0; i < n - 2; ++i) {
    ans = ans * 2 % M;
  }
  for (int i = 1; i <= m; ++i) {
    ans = ans * i % M;
  }
  for (int i = 1; i <= n - 1; ++i) {
    ans = ans * iv[i] % M;
  }
  for (int i = 1; i <= m - (n - 1); ++i) {
    ans = ans * iv[i] % M;
  }
  ans = ans * (n - 2) % M;
  ans = ans * iv[2] % M;
  cout << ans;
}
