#include using namespace std; using ll = long long; bool chmin(auto &a, auto b) { return a > b ? a = b, true : false; } bool chmax(auto &a, auto b) { return a < b ? a = b, true : false; } #include using mint = atcoder::modint998244353; const mint fac_memo[] = { 1, 808258749, 117153405, 761699708, 573994984, 62402409, 511621808, 242726978, 887890124, 875880304 }; mint fac(int n) { int m = n / (int)1e8; mint res = fac_memo[m]; m *= (int)1e8; while (m < n) { res *= ++m; } return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, K; cin >> N >> K; if (N < mint::mod()) { cout << (fac(N) * (fac(N - K) * fac(K)).inv()).val() << endl; } else { if (K < mint::mod() && N - K < mint::mod()) { cout << 0 << '\n'; } else { K = min(K, N - K); mint a = 1, b = 1; for (int i = 0; i < K; i++) { a *= N - i; b *= i + 1; } cout << (a / b).val() << endl; } } }