#include <bits/stdc++.h>
using namespace std;
long long n, m, a[200005], mod(998244353);
void factorial() {
  a[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    a[i] = a[i - 1] * i % mod;
  }
}
long long pw(long long x, long long y) {
  if (!y) {
    return 1;
  }
  long long sum = pw(x, y / 2);
  sum = sum * sum % mod;
  if (y % 2) {
    sum = sum * x % mod;
  }
  return sum;
}
long long inverse(long long x) {
  return a[m] * pw(a[x], mod - 2) % mod * pw(a[m - x], mod - 2) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  factorial();
  cin >> n >> m;
  cout << inverse(n - 1) * pw(2, n - 3) % mod * (n - 2) % mod << '\n';
}
