#include <stdio.h>
#include <stdlib.h>

#define K	1000000
#define L_	21	/* L_ = ceil(log2(K * 2 + 1)) */
#define N_	(1 << L_)
#define MD	998244353

long long power(long long a, int k) {
	long long p = 1;

	while (k) {
		if (k & 1)
			p = p * a % MD;
		a = a * a % MD;
		k >>= 1;
	}
	return p;
}

int inv(int a) {
	return a == 1 ? 1 : (long long) inv(a - MD % a) * (MD / a + 1) % MD;
}

int vv[K + 1], ff[K + 1], gg[K + 1];
int *wu[L_ + 1], *wv[L_ + 1];

void init() {
	int i, l, u, v;

	ff[0] = gg[0] = 1;
	for (i = 1; i <= K; i++) {
		vv[i] = i == 1 ? 1 : (long long) vv[i - MD % i] * (MD / i + 1) % MD;
		ff[i] = (long long) ff[i - 1] * i % MD;
		gg[i] = (long long) gg[i - 1] * vv[i] % MD;
	}
	u = power(3, MD - 1 >> L_), v = power(u, MD - 2);
	for (l = L_; l > 0; l--) {
		int n = 1 << l - 1;

		wu[l] = (int *) malloc(n * sizeof *wu[l]);
		wv[l] = (int *) malloc(n * sizeof *wv[l]);
		wu[l][0] = wv[l][0] = 1;
		for (i = 1; i < n; i++) {
			wu[l][i] = (long long) wu[l][i - 1] * u % MD;
			wv[l][i] = (long long) wv[l][i - 1] * v % MD;
		}
		u = (long long) u * u % MD, v = (long long) v * v % MD;
	}
}

int choose(int n, int k) {
	return k < 0 || k > n ? 0 : (long long) ff[n] * gg[k] % MD * gg[n - k] % MD;
}

void ntt_(int *aa, int l, int inverse) {
	if (l > 0) {
		int n = 1 << l, m = n >> 1, i, j, *ww = inverse ? wv[l] : wu[l];

		ntt_(aa, l - 1, inverse), ntt_(aa + m, l - 1, inverse);
		for (i = 0; (j = i + m) < n; i++) {
			int a = aa[i], b = (long long) aa[j] * ww[i] % MD;

			if ((aa[i] = a + b) >= MD)
				aa[i] -= MD;
			if ((aa[j] = a - b) < 0)
				aa[j] += MD;
		}
	}
}

void ntt(int *aa, int l_, int inverse) {
	int n = 1 << l_, i, j;

	for (i = 1, j = 0; i < n; i++) {
		int b, tmp;

		b = n >> 1;
		while ((j ^= b) < b)
			b >>= 1;
		if (i < j)
			tmp = aa[i], aa[i] = aa[j], aa[j] = tmp;
	}
	ntt_(aa, l_, inverse);
}

int main() {
#if 0
	static int dp[11][11], dq[11][11];
	int n = 10, l = 3, i, j, k;

	init();
	dp[0][0] = 1, dq[0][0] = 0;
	for (i = 1; i <= n; i++) {
		for (j = i; j <= n; j++)
			for (k = 0; k <= j; k++) {
				dp[i][j] = (dp[i][j] + (long long) dp[i - 1][k] * choose(j, k)) % MD;
				dq[i][j] = (dq[i][j] + (long long) dq[i - 1][k] * choose(j, k) + (long long) dp[i - 1][k] * choose(j, k) % MD * choose(j - k, l)) % MD;
			}
		printf("(%d %d)\n", dp[i][i], dq[i][i]);
	}
	/* guess: (# of more-equal arrays with a_1 = a_2 = ... = a_l) == (n + 1)^(n - l) */
#else
	static int aa[N_], bb[N_];
	int n, k, n_, l_, i, v, f, p, ans;

	init();
	scanf("%d%d", &n, &k);
	l_ = 0;
	while (1 << l_ <= k + k)
		l_++;
	n_ = 1 << l_;
	for (i = 0; i <= k; i++)
		aa[i] = (long long) (i % 2 == 0 ? 1 : MD - 1) * gg[i] % MD;
	for (i = 0; i <= k; i++)
		bb[i] = power(i, k) * gg[i] % MD;
	ntt(aa, l_, 0), ntt(bb, l_, 0);
	for (i = 0; i < n_; i++)
		aa[i] = (long long) aa[i] * bb[i] % MD;
	ntt(aa, l_, 1);
	v = inv(n_);
	for (i = 0; i < n_; i++)
		aa[i] = (long long) aa[i] * v % MD;
	ans = 0;
	f = 1, p = power(n + 1, n), v = inv(n + 1);
	for (i = 1; i <= k; i++) {
		f = (long long) f * (n - i + 1) % MD;
		p = (long long) p * v % MD;
		ans = (ans + (long long) aa[i] * f % MD * p) % MD;
	}
	printf("%d\n", ans);
#endif
	return 0;
}
