ll n,k;mint v[5d4];{rd(n,k);*v=1;rep(i,2,n+1){v[1..k]+=v[0..];v[-(-k..-i)]-=v[-(i-k..)];}wt(sum(v(k+1)));}