#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) using mint = modint1000000007; mint dp[100001]; int main(){ int n,l; cin >> n >> l; dp[0] = 1; for (int i = 0; i < n;i++){ if (i > 0) dp[i] += dp[i-1]; dp[i+1] += dp[i]; if (i-l >= 0) dp[i+1] -= dp[i-l]; } //for (int i = 0; i <= n;i++){ // cout << dp[i].val() << " "; //} //cout << endl; cout << dp[n].val() << endl; return 0; }