atcoder#ABC156E. [ABC156E] Roaming

[ABC156E] Roaming

Score : 500500 points

Problem Statement

There is a building with nn rooms, numbered 11 to nn.

We can move from any room to any other room in the building.

Let us call the following event a move: a person in some room ii goes to another room j(ij)j \sim (i \neq j).

Initially, there was one person in each room in the building.

After that, we know that there were exactly kk moves happened up to now.

We are interested in the number of people in each of the nn rooms now. How many combinations of numbers of people in the nn rooms are possible?

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

Constraints

  • All values in input are integers.
  • 3n2×1053 \leq n \leq 2 \times 10^5
  • 2k1092 \leq k \leq 10^9

Input

Input is given from Standard Input in the following format:

nn kk

Output

Print the number of possible combinations of numbers of people in the nn rooms now, modulo (109+7)(10^9 + 7).

3 2
10

Let c1c_1, c2c_2, and c3c_3 be the number of people in Room 11, 22, and 33 now, respectively. There are 1010 possible combination of (c1,c2,c3)(c_1, c_2, c_3):

  • (0,0,3)(0, 0, 3)
  • (0,1,2)(0, 1, 2)
  • (0,2,1)(0, 2, 1)
  • (0,3,0)(0, 3, 0)
  • (1,0,2)(1, 0, 2)
  • (1,1,1)(1, 1, 1)
  • (1,2,0)(1, 2, 0)
  • (2,0,1)(2, 0, 1)
  • (2,1,0)(2, 1, 0)
  • (3,0,0)(3, 0, 0)

For example, (c1,c2,c3)(c_1, c_2, c_3) will be (0,1,2)(0, 1, 2) if the person in Room 11 goes to Room 22 and then one of the persons in Room 22 goes to Room 33.

200000 1000000000
607923868

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

15 6
22583772