~/algor $ cat problems/kombinatorika-konfetlarni-taqsimlash
Distributing candies
Medium
1000 ms
128 MB
51%
$n$ identical candies must be distributed among $k$ children. Every candy goes to someone, but some children may get none. Two distributions are different if at least one child gets a different number of candies in them. In how many ways can the candies be distributed? Print the answer modulo $10^{9} + 7$.
Input
One line with two integers: $n$ and $k$.
Output
One integer — the number of ways modulo $10^{9} + 7$.
Note
$0 \le n \le 10^{6}$
$1 \le k \le 10^{6}$
Examples
Input #1
4 3
Output #1
15
Input #2
5 1
Output #2
1