#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() const ll mod = 998244353ll; ll modpow(ll a, ll n, ll m) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % m; a = a * a % m; n >>= 1; } return res; } ll modinv(ll a, ll m) { return modpow(a, m - 2, m); } ll modfact(ll a, ll m) { ll res = 1; while (a > 0) { res *= a; res %= m; a--; } return res; } int main() { cin.tie(nullptr); ll N, M; cin >> N >> M; ll ans = modfact(M, mod); ll num = M / N; ll left = M - N * num; ans = ans * modinv(modpow(modfact(num + 1, mod), left, mod), mod) % mod; ans = ans * modinv(modpow(modfact(num, mod), (N - left), mod), mod) % mod; cout << ans << '\n'; }