#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  register long long x = 0, f = 1;
  register char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
  return x * f;
}
void work() {}
long long n, m, now, ans, A[200000 + 10], w[200000 + 10];
long long C(long long x, long long y) {
  if (x < y || y < 0) return 0;
  return (A[x] * w[x - y] % 998244353) * w[y] % 998244353;
}
long long qpow(long long a, long long p) {
  long long Ans = 1;
  while (p) {
    if (p & 1) Ans = (Ans * a) % 998244353;
    a = (a * a) % 998244353;
    p /= 2;
  }
  return Ans;
}
void in() {
  A[0] = 1;
  for (register long long i = (1), iLimit = (200000); i <= iLimit; (++(i)))
    A[i] = A[i - 1] * i % 998244353;
  w[200000] = qpow(A[200000], 998244353 - 2);
  for (register long long i = (200000), iLimit = (1); i >= iLimit; (--(i)))
    w[i - 1] = w[i] * i % 998244353;
}
signed main() {
  n = read(), m = read();
  in();
  work();
  for (register long long i = (1), iLimit = (m); i <= iLimit; (++(i)))
    now = (C(m - 1, n - 2) - C(i - 1, n - 2) + 998244353) % 998244353,
    ans = (ans +
           now *
               ((qpow(2, n - 1) - 2 * qpow(2, n - 3) % 998244353 + 998244353) %
                998244353) %
               998244353) %
          998244353;
  printf("%lld\n",
         (ans * (qpow(2, 998244353 - 2) % 998244353) + 998244353) % 998244353);
  return 0;
  long long zmy = 213123, zzz = 213132, cyz = 21313;
}
