#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
bool customCompare(const pair<int, int> &a, const pair<int, int> &b) {
  return a.first < b.first;
}
long long comb(long long n, long long r) {
  if ((n - r) < r) r = n - r;
  map<long long, long long> m;
  for (long long i = n; i > n - r; i--) {
    long long temp = i;
    while (temp % 2 == 0) {
      m[2]++;
      temp /= 2;
    }
    for (long long j = 3; j * j <= temp; j += 2) {
      while (temp % j == 0) {
        temp /= j;
        m[j]++;
      }
    }
    if (temp > 1) m[temp]++;
  }
  for (long long i = 2; i <= r; i++) {
    long long temp = i;
    while (temp % 2 == 0) {
      m[2]--;
      temp /= 2;
    }
    for (long long j = 3; j * j <= temp; j += 2) {
      while (temp % j == 0) {
        temp /= j;
        m[j]--;
      }
    }
    if (temp > 1) m[temp]--;
  }
  long long ans = 1;
  for (auto it = m.begin(); it != m.end(); it++) {
    long long x = it->first;
    long long y = it->second;
    for (long long i = 0; i < y; i++) {
      ans *= x;
      ans %= 998244353ll;
    }
  }
  return ans;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long ans = comb(m, n - 1);
  ans %= 998244353ll;
  ans *= (n - 2);
  ans %= 998244353ll;
  for (long long i = 0; i < n - 3; i++) {
    ans *= 2;
    ans %= 998244353ll;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
