#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long z = 1000000000;
const long long N = 1e9 + 1;
const long long INF = 1e18;
long long mod2 = 998244353;
template <typename T, typename T1>
T amax(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
long long t, n, m;
long long powe(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long t = powe(x, y / 2);
  t = (t * t) % mod2;
  if (y % 2 == 1) t = (t * x) % mod2;
  return t;
}
void solve() {
  cin >> n >> m;
  if (n == 2) {
    cout << 0 << endl;
    return;
  }
  vector<long long> fact(1000001, 0);
  fact[0] = 1;
  for (int i = 1; i <= 1000000; i++) fact[i] = (fact[i - 1] * i) % mod2;
  vector<long long> inv(1000001, 0);
  inv[0] = 1;
  for (int i = 1; i <= 1000000; i++) {
    inv[i] = (inv[i - 1] * powe(i, mod2 - 2)) % mod2;
  }
  long long ans = ((fact[m] * inv[n - 1]) % mod2 * inv[m + 1 - n]) % mod2;
  ans = (ans * powe(2, n - 3)) % mod2;
  ans = (ans * (n - 2)) % mod2;
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  t = 1;
  while (t--) {
    solve();
  }
}
