#include template class BinomialCoefficients { int max; U mod; T *factorial; T *factorial_inverse; T *inverse; public: T get(int n, int k) { if (n < 0 || k < 0 || k > n) return 0; else return factorial[n] * (factorial_inverse[k] * factorial_inverse[n - k] % mod) % mod; } BinomialCoefficients(int max, U mod) : max(max), mod(mod) { factorial = new T[max + 1]; factorial_inverse = new T[max + 1]; inverse = new T[max + 1]; factorial[0] = factorial[1] = 1; factorial_inverse[0] = factorial_inverse[1] = 1; inverse[1] = 1; for (int k = 2; k <= max; k++) { factorial[k] = factorial[k - 1] * k % mod; inverse[k] = mod - inverse[mod % k] * (mod / k) % mod; factorial_inverse[k] = factorial_inverse[k - 1] * inverse[k] % mod; } } ~BinomialCoefficients() { delete[] factorial; delete[] factorial_inverse; delete[] inverse; } }; const int MOD = 998244353; template constexpr T power(T b, U e, V mod) { if (b >= mod) b %= mod; T ret = 1; while (e) { if (e & 1) { ret *= b; ret %= mod; } b *= b; b %= mod; e >>= 1; } return ret; } template constexpr T power(T b, U e) { return power(b, e, MOD); } using namespace std; int main() { int N, K; cin >> N >> K; BinomialCoefficients binom(N, MOD); long long ans = 0; for (int i = 1; i < N; i++) { ans += binom.get(N - 1, i) * power(i, K) % MOD; if (ans >= MOD) ans -= MOD; } cout << ans << endl; return 0; }