P23567 [AtCoder] Colorful Star
NOI
题目描述

Problem Statement

There is a tree with NM+1 vertices numbered 0 to NM. The $i-th edge (1 \le i \le NM) connects vertices i$ and $\max(i-N,0)$.
Initially, vertex i is colored with color $i \bmod N.$ You can perform the following operation zero or more times:

  • Choose two vertices u and v connected by an edge. Repaint the color of vertex u with that of vertex v.

Find the number, modulo 998244353, of possible trees after the operations. Two trees are distinguished if and only if some vertex has different colors.

Input

The input is given from Standard Input in the following format:
N M

Output

Print the answer.

Constraints

  • $1 \le N, M \le 2 \times 10^5$

Sample Input 1

3 1

Sample Output 1

42

One possible sequence of operations is as follows. Including this one, there are 42 possible final trees.

Sample Input 2

4 2

Sample Output 2

219100

Sample Input 3

20 24

Sample Output 3

984288778

Sample Input 4

123456 112233

Sample Output 4

764098676

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1
样例输出
42