When Mike Ehrmantraut started being a cop, he wanted all people to be equal before the law. Now he is retired, but he still prefers almost equal arrays.
Here two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$ are called almost equal if the following condition holds:
For any $$$1 \leq i \lt j \leq n$$$, $$$min(a_i, b_j) = min(a_j, b_i)$$$
Given two integers $$$n$$$ and $$$m$$$, find the number of almost equal pairs $$$(a, b)$$$ of integer arrays of length $$$n$$$ with elements from $$$1$$$ to $$$m$$$. As this number can be large, output it modulo $$$998244353$$$.
The only line of the input contains two integers $$$n, m$$$ ($$$1 \leq n, m \leq 10^6$$$).
Output a single integer — output to the problem modulo $$$998244353$$$.
1 3
9
2 2
10
69 42
608932821
In the first sample, any pair of arrays $$$([x], [y])$$$ with $$$1 \leq x, y \leq 3$$$ satisfies the conditions from the statement, there are $$$9$$$ of them.
In the second sample, there are the $$$10$$$ pairs of arrays: $$$([1, 1], [1, 1])$$$, $$$([1, 1], [1, 2])$$$, $$$([1, 1], [2, 1])$$$, $$$([1, 1], [2, 2])$$$, $$$([1, 2], [1, 1])$$$, $$$([1, 2], [1, 2])$$$, $$$([2, 1], [1, 1])$$$, $$$([2, 1], [2, 1])$$$, $$$([2, 2], [1, 1])$$$, $$$([2, 2], [2, 2])$$$.
| Название |
|---|


