#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 998244353;
ll pw(ll x, ll a) {
  if (a == 0) return 1;
  ll s = pw(x, a / 2);
  s = (s * s) % MOD;
  if (a % 2) s = (x * s) % MOD;
  return s;
}
ll inv(ll x) { return pw(x, MOD - 2); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n, m;
  cin >> n >> m;
  if (n == 2)
    cout << 0 << endl;
  else {
    ll res = (n - 2);
    for (ll i = m - n + 2; i <= m; ++i) res = (res * i) % MOD;
    for (ll i = 1; i <= n - 1; ++i) res = (res * inv(i)) % MOD;
    for (int r = 0; r < n - 3; ++r) res = (res * 2) % MOD;
    cout << res << endl;
  }
}
