Equalizer Ehrmantraut

Time limit: 0.7s Memory limit: 256MB Input: Output:

You know how they say, 'It's been a pleasure?' It hasn't.

  • Mike Ehrmantraut, Breaking Bad

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 \textbf{almost equal} arrays.

Here two arrays aa and bb of length nn are called \textbf{almost equal} if the following condition holds:

  • For any 1i<jn1 \leq i < j \leq n, min(ai,bj)=min(aj,bi)min(a_i, b_j) = min(a_j, b_i)

Given two integers nn and mm, find the number of \textbf{almost equal} pairs (a,b)(a, b) of integer arrays of length nn with elements from 11 to mm. As this number can be large, output it modulo 998 244 353998 \ 244 \ 353.

Input data

The only line of the input contains two integers n,mn, m (1n,m1061 \leq n, m \leq 10^6).

Output data

Output a single integer - output to the problem modulo 998 244 353998 \ 244 \ 353.

Example 1

stdin

1 3

stdout

9

Explanation

In the first sample, any pair of arrays ([x],[y])([x], [y]) with 1x,y31 \leq x, y \leq 3 satisfies the conditions from the statement, there are 99 of them.

Example 2

stdin

2 2

stdout

10

Explanation

In the second sample, there are the 1010 pairs of arrays: ([1,1],[1,1])([1, 1], [1, 1]), ([1,1],[1,2])([1, 1], [1, 2]), ([1,1],[2,1])([1, 1], [2, 1]), ([1,1],[2,2])([1, 1], [2, 2]), ([1,2],[1,1])([1, 2], [1, 1]), ([1,2],[1,2])([1, 2], [1, 2]), ([2,1],[1,1])([2, 1], [1, 1]), ([2,1],[2,1])([2, 1], [2, 1]), ([2,2],[1,1])([2, 2], [1, 1]), ([2,2],[2,2])([2, 2], [2, 2]).

Example 3

stdin

69 42

stdout

608932821

Log in or sign up to be able to send submissions!