Sunday Coding

Count the distinct sequences of room-winner ranks obtainable when R rooms each hold S contestants with all ranks distinct.

Medium7CombinatoricsDynamic programmingMathNo attempts yetTime limit2sMemory limit512 MB

Problem

Yeongseon is entering the online programming contest "Sunday Coding".

While the contest runs, the participants are split into RR rooms and each room holds SS participants, so there are R×SR \times S participants in total. The rooms are numbered from 11 to RR.

Nobody ties, so once the contest ends every participant receives a distinct rank from 11 (the overall win) to R×SR \times S.

The winner of a room is the participant with the best rank in that room.

After the contest Yeongseon writes down the rank of each room winner in room order, which gives a sequence of length RR. The ii-th number of the sequence is the rank of the winner of room ii.

Given RR and SS, write a program that counts the different sequences that can be produced this way.

Input

The first line contains RR and SS, separated by a space. (1R,S1001 \le R, S \le 100)

Output

On the first line, print the number of different sequences that can be produced, modulo 1,000,000,007.

Hint

For R=2R = 2 and S=1S = 1 there are two rooms with one participant each, so the sequence is either (1,2)(1, 2) or (2,1)(2, 1).

For R=2R = 2 and S=2S = 2 the sequences that can be produced are (1,2)(1, 2), (2,1)(2, 1), (1,3)(1, 3), (3,1)(3, 1). Neither (2,3)(2, 3) nor (1,4)(1, 4) is ever possible.