AT_fps_24_e 数列 3
Description
Consider integer sequences $ A = (a_1,a_2,\dots,a_N) $ of length $ N $ , where each element is a positive integer not greater than $ M $ .
Count how many such sequences satisfy the following condition, and output the result modulo $ 998244353 $ .
- For every integer $ m $ such that $ 1 \leq m \leq M $ , the number of times $ m $ appears in $ A $ is at most $ m $ .
Input Format
The input is given from standard input in the following format:
> $ N $ $ M $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
There are $ 8 $ sequences that satisfy the condition:
- $ (1, 2) $
- $ (1, 3) $
- $ (2, 1) $
- $ (2, 2) $
- $ (2, 3) $
- $ (3, 1) $
- $ (3, 2) $
- $ (3, 3) $
### Constraints
- $ 1 \leq N \leq 300 $
- $ 1 \leq M \leq 300 $
- $ N, M $ are integers