class Fenwick_Tree: def __init__(self, n): self._n = n self.data = [0] * n def add(self, p, x): assert 0 <= p < self._n p += 1 while p <= self._n: self.data[p - 1] += x self.data[p - 1] %= mod p += p & -p def sum(self, l, r): assert 0 <= l <= r <= self._n return self._sum(r) - self._sum(l) def _sum(self, r): s = 0 while r > 0: s += self.data[r - 1] s %= mod r -= r & -r return s % mod def get(self, k): k += 1 x, r = 0, 1 while r < self._n: r <<= 1 len = r while len: if x + len - 1 < self._n: if self.data[x + len - 1] < k: k -= self.data[x + len - 1] x += len len >>= 1 return x N, K = map(int, input().split()) inv = [1] * (N + 1) mod = 998244353 for i in range(1, N + 1): inv[i] = pow(i, mod - 2, mod) # pre = [0] * (N + 1) # pre[0] = 1 pre = Fenwick_Tree(N + 1) ans = 0 pre.add(0, 1) pre.add(1, -1) for k in range(K): now = Fenwick_Tree(N + 1) for i in range(N): # for j in range(i + 1, N + 1): # now[j] += inv[N - i] * pre[i] v = inv[N - i] * pre.sum(0, i + 1) % mod now.add(i + 1, v) ans += v ans %= mod pre, now = now, pre print(ans)