#include <bits/stdc++.h>
using namespace std;
vector<long long> factorial;
long long binPow(long long x, long long power) {
  long long result = 1;
  while (power) {
    if (power & 1) result = (result * x) % 998244353;
    x = (x * x) % 998244353;
    power >>= 1;
  }
  return result;
}
long long C(long long n, long long m) {
  return ((factorial[n] * binPow(factorial[m], 998244353 - 2)) % 998244353 *
          binPow(factorial[n - m], 998244353 - 2)) %
         998244353;
}
void solve() {
  factorial.assign(200001, 1);
  for (long long i = 2; i < 200001; ++i) {
    factorial[i] = (factorial[i - 1] * i) % 998244353;
  }
  long long n;
  cin >> n;
  long long m;
  cin >> m;
  long long sum = 0;
  if (n == 2) {
    cout << "0\n";
    return;
  }
  for (long long maxN = n - 1; maxN <= m; ++maxN) {
    sum = (sum + ((C(maxN - 1, n - 2) * (n - 2) % 998244353) *
                  binPow(2, n - 3) % 998244353)) %
          998244353;
  }
  cout << sum;
}
signed main(signed argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  if (argc > 1 && (string)argv[1] == "local") {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    solve();
    while (cin.peek() != EOF) {
      if (isspace(cin.peek()))
        cin.get();
      else {
        cout << '\n';
        solve();
      }
    }
  } else {
    solve();
  }
}
