#abc172e. [abc172_e]NEQ

[abc172_e]NEQ

Problem Statement

Count the pairs of length-NN sequences consisting of integers between 11 and MM (inclusive), A1,A2,cdots,ANA_1, A_2, \\cdots, A_{N} and B1,B2,cdots,BNB_1, B_2, \\cdots, B_{N}, that satisfy all of the following conditions:

  • AineqBiA_i \\neq B_i, for every ii such that 1leqileqN1\\leq i\\leq N.
  • AineqAjA_i \\neq A_j and BineqBjB_i \\neq B_j, for every (i,j)(i, j) such that 1leqi<jleqN1\\leq i < j\\leq N.

Since the count can be enormous, print it modulo (109+7)(10^9+7).

Constraints

  • 1leqNleqMleq5times1051\\leq N \\leq M \\leq 5\\times10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM

Output

Print the count modulo (109+7)(10^9+7).


Sample Input 1

2 2

Sample Output 1

2

A1=1,A2=2,B1=2,B2=1A_1=1,A_2=2,B_1=2,B_2=1 and A1=2,A2=1,B1=1,B2=2A_1=2,A_2=1,B_1=1,B_2=2 satisfy the conditions.


Sample Input 2

2 3

Sample Output 2

18

Sample Input 3

141421 356237

Sample Output 3

881613484