#include #include #define int long long using namespace std; int mod = 998244353; int N, M; int fact[1000001], inv[1000001], finv[1000001]; void init(int n) { fact[0] = fact[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i <= n; i++) { fact[i] = i * fact[i - 1] % mod; inv[i] = mod - inv[mod % i] * (mod / i) % mod; finv[i] = finv[i - 1] * inv[i] % mod; } } signed main() { cin >> N >> M; init(max(N, M)); int ans = fact[M]; for (int i = 0; i < N; i++) { int x = (M / N) + (i < M % N); //cout << "x = " << x << endl; ans *= finv[x]; ans %= mod; } cout << ans << endl; return 0; }