#include #include using namespace atcoder; using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) using ll = long long; using mint = modint998244353; constexpr int MAX = 3e5; mint fac[MAX], finv[MAX]; void combinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i-1] * mint(i); finv[i] = finv[i-1] * mint(i).inv(); } } mint comb(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * finv[k] * finv[n-k]; } int main(){ combinit(); int n, k; cin >> n >> k; mint ans = 0; for(int i = 1; i <= n-1; i++) ans += mint(i).pow(k)*comb(n-1,i); cout << ans.val() << endl; return 0; }