#include using namespace std; typedef long long ll; int main(){ int n,l; cin>>n>>l; const ll mod=1e9+7; ll dp[n+1]; dp[0]=1; dp[1]=1; ll ruiseki=2; for(int i=2;i<=n;i++){ if(i-l>0){ ruiseki=(ruiseki-dp[i-l-1]+mod)%mod; } dp[i]=ruiseki; ruiseki=(ruiseki+dp[i])%mod; } cout<