Universal Cup Judging System

Universal Cup

Time Limit: 1.5 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

For a permutation $p$ of length $n$, we define $f(p)$ to represent the position of the prefix maximum. Specifically, $f(p) = \{i \mid 1 \le i \le n, \text{ s.t. } \forall 1 \le j < i, p_i > p_j\}$.

Similarly, let $g(p)$ represent the set of numbers of the prefix maximum, that is, $g(p) = \{p_i \mid i \in f(p)\}$.

Now there are $k$ independently and uniformly randomly chosen permutations $p_1, p_2, \ldots, p_k$ from all permutations of length $n$ (can be repeated). Little A wants to know how many essentially different $g(p)$ there are expected among these permutations. The goal is to find out how many essentially different sets are expected among $g(p_1), g(p_2), \ldots, g(p_k)$? The answer should be output modulo $998244353$.

Input

A single line containing two integers $n, k$ ($1 \le n, k \le 5000$).

Output

A single line containing an integer representing the result of the answer modulo $998244353$.

Examples

Input 1

1 1

Output 1

1

Input 2

3 2

Output 2

388206139

Input 3

3 4

Output 3

408232647

Input 4

112 646

Output 4

928854225

Note

For the first sample, the answer is $1$.

For the second sample, the answer is $\frac{31}{18}$.

For the third sample, the answer is $\frac{1711}{648}$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.