Good Sets

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 512M

Author:
Problem types

A set is called a good set if every element is a positive integer not exceeding N, and any two distinct elements of the set have an absolute difference of at least M.

Find the number of good sets modulo 10^9+7.

Constraints

1 \le M \le N \le 10^6

Subtask 1 [10%]

1 \le N \le 10

Subtask 2 [30%]

1 \le N \le 10^4

Subtask 3 [60%]

No additional constraints.

Input Specification

The only line contains two space-separated integers, N and M.

Output Specification

Output the number of good sets modulo 10^9+7.

Sample Input

4 3

Sample Output

6

Explanation for Sample

The good sets are \{\}, \{1\}, \{2\}, \{3\}, \{4\}, \{1, 4\}.


Comments

There are no comments at the moment.