Permutaion

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2820
64-bit integer IO format: %I64d      Java class name: Main

Description

As we known, there are N! permutations of {1,2,...N}. Now you are requested to find how many permutations satisfying that, the difference of every two adjacent numbers is not more than K. Because the answer may be quite large, you only need to output the answer module (%) 1,000,000,007.

You can assume 2 <= N <= 50 and 0 <= K <= 4.

Input

There are several lines of the input. Each line indicates one test case, and contains two numbers N and K.

Output

Output one line for each test case, indicating the answer module 1,000,000,007.

Sample Input

4 2

Sample Output

12

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .