#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
long long n, m;
long long fac[200005];
array<long long, 3> egcd(long long a, long long b) {
  if (a == 0) return {b, 0, 1};
  array<long long, 3> res = egcd(b % a, a);
  long long y = res[1];
  long long x = res[2];
  res[1] = x - (b / a) * y;
  res[2] = y;
  return res;
}
long long modinv(long long a) {
  array<long long, 3> res = egcd(a, MOD);
  return res[1] % MOD;
}
long long power(long long b, long long e) {
  if (e == 0) return (long long)1;
  if (e == 1) return b;
  if (e & 1) {
    long long r = power(b, e / 2);
    return r * r % MOD * b % MOD;
  }
  long long r = power(b, e / 2);
  return r * r % MOD;
}
int main() {
  cin >> n;
  cin >> m;
  fac[0] = 1;
  fac[1] = 1;
  for (int x = 2; x < 200004; ++x) {
    fac[x] = (long long)fac[x - 1] * x % MOD;
  }
  long long ans = 0;
  long long y = n - 2;
  for (int pv = 1; pv <= m; ++pv) {
    int x = pv - 1;
    if (x < y) continue;
    long long bns = fac[x] % MOD;
    bns *= modinv(fac[x - y]) % MOD;
    bns %= MOD;
    bns *= modinv(fac[y]) % MOD;
    bns %= MOD;
    bns *= power(2, y - 1) % MOD;
    bns %= MOD;
    bns *= y;
    bns %= MOD;
    if (bns < 0) bns += MOD;
    ans += bns;
    ans %= MOD;
    if (ans < 0) ans += MOD;
  }
  cout << ans;
  return 0;
}
