#abc156e. E - Roaming

E - Roaming

Score : 500500 points

问题陈述

存在一座包含 nn 个房间的建筑,房间编号为 11nn

在该建筑中,我们可以从任意一个房间移动到另一个房间。

我们将以下事件定义为一次移动:一个人从某个房间 ii 移动到另一个房间 j (ij)j~ (i \neq j)

最初,建筑中的每个房间都恰好有一个人。

之后,我们知道到现在为止共发生了恰好 kk 次移动。

我们关注现在这 nn 个房间中每个人数的情况。可能有多少种不同的人数组合?

请计算这个组合数对 (109+7)(10^9 + 7) 取模的结果。

以上为通义千问 qwen-max 翻译,仅供参考。

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~ (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).

Sample Input 1

3 2

Sample Output 1

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.

Sample Input 2

200000 1000000000

Sample Output 2

607923868

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

Sample Input 3

15 6

Sample Output 3

22583772

update @ 2024/3/10 17:16:11