P17017 [GESP202606 Level 8] Piling Stones
Description
There are $m$ piles of stones, numbered $1, 2, \cdots, m$, and the number of stones in each pile is denoted by $a_1, a_2, \cdots, a_m$, respectively.
Now we require that the $1$st pile has exactly $n$ stones (that is, $a_1 = n$), and that for every pile after that, the number of stones is strictly less than the previous pile, i.e. $a_i < a_{i-1}$ ($2 \le i \le m$). In addition, each pile must contain at least one stone, i.e. $a_i \ge 1$ ($1 \le i \le m$).
With no restriction on the total number of stones, given $m \ge 2$ and $n \ge 1$, how many stone-piling configurations satisfy the requirements?
Two configurations are different if and only if there exists at least one pile whose number of stones is different between the two configurations.
If no configuration satisfies the requirements, output $0$. Since the number of configurations may be very large, output the result modulo $10^9 + 7$.
Input Format
Input one line containing two positive integers $m$ and $n$.
Output Format
Output one integer, representing the total number of configurations modulo $10^9 + 7$.
Explanation/Hint
### Sample Explanation 1
There are a total of $6$ configurations: $(5, 4, 3)$, $(5, 4, 2)$, $(5, 4, 1)$, $(5, 3, 2)$, $(5, 3, 1)$, and $(5, 2, 1)$.
### Constraints
::cute-table{tuack}
| Test Point ID | Constraints | Special Properties |
|:-:|:-:|:-:|
| $1,2$ | $2 \le m \le 100, 1 \le n \le 100$ | $0 \le n - m \le 5$ |
| $3,4,5$ | $2 \le m \le 100, 1 \le n \le 10^8$ | None |
| $6,7,8,9,10$ | $2 \le m \le 10^5, 1 \le n \le 10^8$ | ^ |
Translated by ChatGPT 5