Consider a sequence of
A pair of numbers in the sequence is confused if the number that comes earlier in the sequence is larger than the later number.
The confusion of the sequence is the number of confused pairs in it. For example, the confusion of the sequence
Write a program that calculates the number of sequences of length
Input Specification
The first and only line of input contains two integers,
Output Specification
Output the number of sequences modulo
Sample Input 1
Copy
10 1
Sample Output 1
Copy
9
Sample Input 2
Copy
4 3
Sample Output 2
Copy
6
Sample Input 3
Copy
9 13
Sample Output 3
Copy
17957
Comments