CSES - Counting Sequences
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Your task is to count the number of sequences of length nn where each element is an integer between 1k1 \dots k and each integer between 1k1 \dots k appears at least once in the sequence.

For example, when n=6n=6 and k=4k=4, some valid sequences are [1,3,1,4,3,2][1,3,1,4,3,2] and [2,2,1,3,4,2][2,2,1,3,4,2].

Input

The only input line has two integers nn and kk.

Output

Print one integer: the number of sequences modulo 109+710^9+7.

Constraints

  • 1kn1061 \le k \le n \le 10^6

Example

Input:

6 4

Output:

1560