#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct compF {
  bool operator()(const pair<T, T> &a, const pair<T, T> &b) {
    return a.first < b.first;
  }
};
template <typename T>
struct compS {
  bool operator()(const pair<T, T> &a, const pair<T, T> &b) {
    return a.second < b.second;
  }
};
template <typename T>
void printMatrix(const string &txt, vector<vector<T>> &a) {
  cout << txt;
  for (int i = 0; i < a.size(); ++i) {
    for (int j = 0; j < a[i].size(); ++j) cout << a[i][j] << ' ';
    cout << endl;
  }
}
template <typename T>
void printVector(const string &txt, vector<T> &a) {
  cout << txt;
  for (int i = 0; i < a.size(); ++i) cout << a[i] << ' ';
  cout << endl;
}
template <typename T>
void readVector(int n, vector<T> &a) {
  if (a.size() < n) a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
}
template <typename T1, typename T2>
bool exist(map<T1, T2> &m, T1 x) {
  if (m.find(x) == m.end()) return false;
  return true;
}
long long gcd(long long a, long long b) {
  while (a != 0 && b != 0) {
    if (b > a)
      b %= a;
    else
      a %= b;
  }
  return a + b;
}
long long minFactor(long long x) {
  for (long long i = 2; i * i <= x; ++i)
    if (x % i == 0) return i;
  return x;
}
long long allFactors(long long x, vector<long long> &prms,
                     vector<long long> &prm_cnt) {
  prms.clear();
  prm_cnt.clear();
  while (x > 1) {
    long long t = minFactor(x);
    prms.push_back(t);
    int s = prms.size() - 1;
    prm_cnt.push_back(0);
    while (x % t == 0) {
      x /= t;
      ++prm_cnt[s];
    }
  }
  return 0;
}
long long add(long long x, long long y) {
  if (x >= 998244353) x %= 998244353;
  if (y >= 998244353) y %= 998244353;
  return (x + y) % 998244353;
}
long long mul(long long x, long long y) {
  if (x >= 998244353) x %= 998244353;
  if (y >= 998244353) y %= 998244353;
  return (x * y) % 998244353;
}
long long pow_(long long x, long long y) {
  if (y == 0) return 1ll;
  if (y % 2 == 0) {
    long long k = pow_(x, y / 2);
    return (k * k) % 998244353;
  } else {
    return mul(x, pow_(x, y - 1));
  }
}
long long n, m;
long long fact[2 * (int)(1e5) + 2], rfact[2 * (int)(1e5) + 2];
long long C(long long n, long long m) {
  long long num = fact[n];
  long long den = mul(rfact[m], rfact[n - m]);
  return mul(num, den);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  fact[0] = fact[1] = rfact[0] = rfact[1] = 1ll;
  for (long long i = 2; i <= 2 * (int)(1e5); ++i) {
    fact[i] = mul(fact[i - 1], i);
    rfact[i] = pow_(fact[i], 998244353 - 2);
  }
  cin >> n >> m;
  if (n == 2) {
    cout << 0 << endl;
    return 0;
  }
  long long t = n - 1;
  long long res = 0;
  long long c = 0;
  for (long long i = t; i <= m; ++i) {
    long long cr = C(i - 1, t - 1);
    c = add(c, cr);
  }
  long long t2 = pow_(2, t - 2);
  res = mul(c, mul(max(t2, 1ll), t - 1));
  cout << res << endl;
  return 0;
}
