#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,unroll-loops") #include #include #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(a) a.begin(), a.end() #define ll long long using namespace std; using namespace atcoder; constexpr int mod = 998244353; using mint = modint998244353; mint fac[5050]; mint inv[5050]; void solve() { fac[0] = 1; for (int i = 1; i < 5050; i++) fac[i] = i * fac[i - 1]; inv[5049] = 1 / fac[5049]; for (int i = 5049; i > 0; i--) inv[i - 1] = i * inv[i]; int n, m; cin >> n >> m; mint ans = 0; for (int k = 1; k <= n; k++) { mint mul = fac[n] * inv[k] * inv[n - k]; if ((n - k) & 1) mul = -mul; mul *= mint(k).pow(n + m); ans += mul; } mint ff = 1; for (int i = 1; i <= n; i++) ff *= i + m; ans /= ff * mint(n).pow(m); cout << ans.val() << '\n'; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(13); solve(); return 0; }