You are given n balls and k boxes. Your task is to calculate the number of ways to distribute these distinguished balls into distinguished boxes under the following conditions:
Each ball is distinct.
Each box is distinct.
Each ball can only be placed in one box and no balls can remain outside of the boxes.
Each box must contain at least one ball.
Note: The result should be printed modulo (10^9 + 7).
Input Format
The first line contains two integers, n (the number of balls) and k (the number of boxes).
Output Format
Print a single integer: the number of ways to distribute the balls into the boxes, modulo (10^9 + 7).
Constraints
(1 \leq k \leq n \leq 10^6)
Examples
Example 1
Input:
text
3 2
Output:
text
6
Explanation:
There are 6 ways to distribute 3 distinct balls into 2 distinct boxes such that each box has at least one ball.
Example 2
Input:
text
5 3
Output:
text
150
Explanation:
There are 150 ways to distribute 5 distinct balls into 3 distinct boxes, ensuring each box contains at least one ball.
Solution Location
The implemented solution should be placed in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.