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 109+7.

Constraints

1MN106

Subtask 1 [10%]

1N10

Subtask 2 [30%]

1N104

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 109+7.

Sample Input

Copy
4 3

Sample Output

Copy
6

Explanation for Sample

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


Comments

There are no comments at the moment.