Balls | Boxes | Any way | At most one ball | At least one ball |
---|---|---|---|---|
Distinguishable | Distinguishable | 1 | 2 | 3 |
Indistinguishable | Distinguishable | 4 | 5 | 6 |
Distinguishable | Indistinguishable | 7 | 8 | 9 |
Indistinguishable | Indistinguishable | 10 | 11 | 12 |
You have n balls and k boxes. You want to put these balls into the boxes.
Find the number of ways to put the balls under the following conditions:
Note that you must print this count modulo 109+7.
n k
The first line will contain two integers n and k.
Print the number of ways modulo 109+7 in a line.
4 3
36
10 3
55980
100 100
437918130