#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n+1); i++) #define repn(i,a,b) for (int i = (int)(a) ; i < (int)(b+1); i++) #define repv(i, n) for (int i = (int)(n-1); i >= 0; i--) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define sz(x) ((int)(x).size()) #define cauto const auto& #define bit(n) (1LL<<(n)) #define uni(v) v.erase( unique(v.begin(), v.end()), v.end() ); using ll = long long; using P = pair; using PP = pair; using Graph = vector>; #ifdef LOCAL #include #define debug(...) debug::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif vector fac(510000,0),finv(510000,0),inv(510000,0); void init() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < 510000; i++){ fac[i] = (fac[i - 1] * i )% 998244353; inv[i] = (-inv[998244353%i] * (998244353/ i)) % 998244353 ; finv[i] =( finv[i - 1] * inv[i] ) % 998244353; } } ll combination(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return (fac[n] * (finv[k] * finv[n - k] % 998244353)) % 998244353; } ll pow_mod(ll a, ll b, ll mod = 998244353){ ll res = 1; while(b > 0){ if(b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } int main(){ int n,k; cin >> n >> k; ll ans = 0; init(); rep1(i,n-1){ ans += combination(n-1,i) * pow_mod(i,k) % 998244353; ans %= 998244353; } if(ans < 0){ ans += 998244353; } cout << ans << endl; return 0; }