~/algor $ cat problems/kombinatorika-yonma-yon-emas
Not side by side
Medium
1000 ms
128 MB
47%
There are $n$ chairs in a row. Choose $k$ of them and seat $k$ students so that no two students sit on adjacent chairs. The students are considered identical: only which chairs are occupied matters. How many ways are there? 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
$1 \le n \le 10^{6}$
$0 \le k \le n$
Examples
Input #1
5 2
Output #1
6
Input #2
3 3
Output #2
0