Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called a k-tree.A k-tree is an infinite rooted tree where:  each vertex has exactly k children;  each edge has some weight;  if we look at the edges that goes from some vertex to its children (exactly k edges), then their weights will equal 1, 2, 3, ..., k. The picture below shows a part of a 3-tree.      As soon as Dima, a good friend of Lesha, found out about the tree, he immediately wondered: "How many paths of total weight n (the sum of all weights of the edges in the path) are there, starting from the root of a k-tree and also containing at least one edge of weight at least d?".Help Dima find an answer to his question. As the number of ways can be rather large, print it modulo 1000000007 (109 + 7).

A single line contains three space-separated integers: n, k and d (1 ≤ n, k ≤ 100; 1 ≤ d ≤ k).

Print a single integer — the answer to the problem modulo 1000000007 (109 + 7).

import sys
import math
input = sys.stdin.readline

def inlt():
    return (list(map(int, input().split())))

def helper(rem, found):
    if rem == 0:
        if found:
            return 1
        return 0

hash_map = {}

def solve(n, found):
    if n == 0:
        if found:
            return 1
        return 0
    if (n, found) in hash_map:
        return hash_map[(n, found)]
    count = 0
    for i in range(1, k+1):
        if i > n:
            break
        count += solve(n-i, found | (True if i >= d else False)) % 1000000007
    hash_map[(n, found)] = count % 1000000007
    return count % 1000000007

if __name__ == '__main__':
    nkd = inlt()
    k, d = nkd[1], nkd[2]

    print(int(solve(nkd[0], False)))

x=map(int,raw_input().split(' '))
path=x[0]
tree=x[1]
d=x[2]
dp=[[0 for x in range(2)] for x in range(200)]
dp[0][1]=1
dp[0][0]=1
for i in range(1,path+1):
    for j in range(1,min(tree,d-1)+1):
        if i<j:
            break
        dp[i][0]+=dp[i-j][0]

for i in range(1,path+1):
    for j in range(1,tree+1):
        if i<j:
            break
        dp[i][1]+=dp[i-j][1]
ans = dp[path][1]-dp[path][0]
ans%=(1000000007)
print(ans)

def sums(n,k, d,  dic):
    count = 0
    limited_count = 0
    for i in range(1, k+1):
        if n - i == 0:
            count += 1
            if n >= d:
                limited_count += 1
        elif n - i < 0:
            pass
        else:
            count += dic[n-i][0]
            if i >= d:
                limited_count += dic[n-i][0]
            else:
                limited_count += dic[n-i][1]
    return (count%(10**9+7), limited_count%(10**9+7))

def tree(n,k,d):
    dic = {}
    for i in range(1,n+1):
        dic[i] = sums(i,k,d, dic)
    return dic[n][1]

lst = list(map(lambda elem: int(elem), input().split(" ")))
print(tree(lst[0], lst[1], lst[2]))

"""
________        _____________              ______
___  __ \____  ____  __ \__(_)__   _______ ___  /
__  /_/ /_  / / /_  /_/ /_  /__ | / /  __ `/_  /
_  ____/_  /_/ /_  _, _/_  / __ |/ // /_/ /_  /
/_/     _\__, / /_/ |_| /_/  _____/ \__,_/ /_/
        /____/

https://github.com/Cheran-Senthil/PyRival
Copyright (c) 2018 Cheran Senthilkumar
"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
import sys
from atexit import register
from bisect import bisect_left, bisect_right

# import random
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    from io import BytesIO as stream
    # from fractions import Fraction
    # from fractions import gcd
    # from cPickle import dumps
    # from Queue import PriorityQueue, Queue
else:
    from io import StringIO as stream
    # from functools import reduce
    # from fractions import Fraction
    # from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue

if sys.version_info[0] < 3:
    class dict(dict):
        def items(self):
            return dict.iteritems(self)

        def keys(self):
            return dict.iterkeys(self)

        def values(self):
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def sync_with_stdio(sync=True):
    """
    Sets whether the standard Python streams are allowed to buffer their I/O.

    Parameters
    ----------
    sync : bool, optional
        The new synchronization setting. Default is True.
    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    n, k, d = map(int, input().split(' '))
    dp = [-1] * 209
    dp_with_d = [-1] * 209

    def count_trees(x):
        if dp[x] != -1:
            return dp[x]
        if x < 1:
            dp[x] = 0
        elif x <= k:
            dp[x] = 1 + sum(count_trees(x - i) for i in range(1, x + 1)) % 1000000007
        else:
            dp[x] = sum(count_trees(x - i) for i in range(1, k + 1)) % 1000000007
        return dp[x]

    def count_trees_with_d(x):
        if dp_with_d[x] != -1:
            return dp_with_d[x]
        if x < d:
            dp_with_d[x] = 0
        elif d <= x <= k:
            dp_with_d[x] = 1 + sum(count_trees(x - i) for i in range(d, x + 1)) + sum(count_trees_with_d(x - i) for i in range(1, d))  % 1000000007
        else:
            dp_with_d[x] = sum(count_trees(x - i) for i in range(d, k + 1)) + sum(count_trees_with_d(x - i) for i in range(1, d))  % 1000000007
        return dp_with_d[x]

    print(count_trees_with_d(n) % 1000000007)

if __name__ == '__main__':
    sys.setrecursionlimit(10000)
    sync_with_stdio()
    main()

n,k,d=list(map(int,input().split()))
dict1={}
for i in range(1,n+1):
    str1=str(i)+"_"+"1"+"_"+"1"
    dict1[str1]=i
for i in range(1,k+1):
    str1="1"+"_"+str(i)+"_"+"1"
    dict1[str1]=1
def solve(n,k,d,z):
    str1=str(n)+"_"+str(k)+"_"+str(d)
    if n==0 or n==d:
        return 1
    if d>k or n<0 or d>n:
        return 0
    if str1 in dict1.keys():
        return dict1[str1]
    else:
        ans=0
        for i in range(k,d-1,-1):
            ans+=solve(n-i,k,1,z)
            ans%=z
        for j in range(1,d):
            ans+=solve(n-j,k,d,z)
            ans%=z
        dict1[str1]=ans
        return ans
z=(10**9)+7
print(solve(n,k,d,z))

def k_tree_basic(n, k):
    D = [0] * (n + 1)
    D[0] = 1
    D[1] = 1
    D[2] = 2
    for i in range(3, n + 1):
        for j in range(1, k + 1):
            if i - j >= 0: D[i] += D[i - j]
    return D

def k_tree(n, k, d):

    abnormal = [0] * (n + 1)
    if d < 1: abnormal[0] = 1
    else: abnormal[0] = 0
    if n == 0: return abnormal[0]
    if d <= 1: abnormal[1] = 1
    else: abnormal[1] = 0
    if n == 1: return abnormal[1]
    if d == 1: abnormal[2] = 2
    elif d == 2: abnormal[2]  = 1
    elif d == 0: abnormal[2] = 2
    else: abnormal[2] = 0
    normal = k_tree_basic(n, k)

    for i in range(3, n + 1):
        for j in range(1, k + 1):
            if j >= d and i - j >= 0: abnormal[i] += normal[i - j]
            elif (i - j) >= 0: abnormal[i] += (abnormal[i - j])
    return abnormal[n]%1000000007

inp = raw_input().split()
n, k, d = int(inp[0]), int(inp[1]), int(inp[2])
print k_tree(n, k, d)

def func(r, k, a) :
    out = 0
    if r <= k:
        out = 2**(r-1)
    else :

        for i in range(1,k+1) :
            if i <= r :
                if a[r-i] != -1 :
                    out = out + a[r-i]
                else:
                    out = out + func(r-i, k, a)
            else :
                break;
    a[r] = out
    return out

n,k,d = map(int, raw_input().split())
x = [-1]*(n+1)
y = [-1]*(n+1)
print (func(n,k,x) - func(n, d-1,y)) % 1000000007

n, k, d = map(int, input().split())
mat = [1]
less = [1]
mod = 10 ** 9 + 7
for i in range(1, n + 1):
    mat.append(sum(mat[max(i - d + 1, 0):]))
    less.append(sum(less[max(i - k, 0):]))
print((less[-1] - mat[-1]) % (mod))

mod = 1000000007
n, k, d = [int(x) for x in raw_input().split()]
totalDP = []
no_d_DP = []
for i in range (n + 1) :
  totalDP.append(0)
  no_d_DP.append(0)
totalDP[0] = 1
no_d_DP[0] = 1

for u in range (1, n + 1) :
  for edge in range (1, k + 1) :
    v = u - edge
    if v < 0 :
      break
    totalDP[u] = totalDP[u] + totalDP[v]
    if (edge < d) :
      no_d_DP[u] = no_d_DP[u] + no_d_DP[v]

answer = (totalDP[n] - no_d_DP[n]) % mod
print(answer)

import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))

n,k,d=I()

md=10**9+7
dp=[[0,0] for i in range(102)]
dp[0][0] = 1
for i in range(1,n+1):
	for j in range(1,k+1):
            if  i<j:
            	break

            if(j < d):
                dp[i][0]=(dp[i][0]+dp[i-j][0])%md
                dp[i][1]=(dp[i][1]+dp[i-j][1])%md
            else:
                dp[i][1]=(dp[i][1]+dp[i-j][0])%md
                dp[i][1]=(dp[i][1]+dp[i-j][1])%md

print(dp[n][1])

from sys import stdin,stdout,setrecursionlimit,maxint
setrecursionlimit(2*10**5)
def listInput():
 return map(long,stdin.readline().split())
def printBS(li):
 for i in xrange(len(li)-1):
  stdout.write("%d "%li[i])
 stdout.write("%d\n"%li[-1])
def sin(): return stdin.readline().rstrip()
#n=distance of path required
#is = 1 if atleast one edge >=d else 0
#dp[n][is] is the number of paths of length n
#dp[n][0] will only have paths ehere all edges <d
#dp[n][1] will have paths having more edges
#ans will be dp[n][1]
n,k,d=listInput()
dp=[[0,0] for i in xrange(n+1)]
dp[0][0]=1# bcoz of root
dp[0][1]=0
MOD=10**9+7
for i in xrange(1,n+1):
 for j in xrange(1,k+1):
  if i-j<0: break
  if j<d:
   dp[i][0]=(dp[i-j][0]+dp[i][0])%MOD
   dp[i][1]=(dp[i-j][1]+dp[i][1])%MOD
  else:
   dp[i][1]=(dp[i-j][0]+dp[i-j][1]+dp[i][1])%MOD
print dp[n][1]

import sys

f = sys.stdin
n, k, d = map(int, f.readline().strip().split())

Nd = [[1]*(n+1), [1]*(n+1)]
Nd[1][0] = 0
Nd[1][1] = 0

for i in range(2,n+1):
    N = 0
    for j in range(1,k+1):
        if i>=j:
            N += Nd[0][i-j]
    Nd[0][i] = N

    # if i==2: continue
    N = 0
    for j in range(1,k+1):
        if i>=j:
            if j>=d:
                N += Nd[0][i-j]
            else:
                N += Nd[1][i-j]
    Nd[1][i] = N

    #print(Nd)

if d>1:
    print(Nd[1][n] % 1000000007)
else:
    print(Nd[0][n] % 1000000007)

bignum = 10**9+7
n, k, d = [int(i) for i in input().split()]
D = [[0 for j in range(2)] for i in range(n+1)]
D[0][0] = 1
for i in range(1, n+1):
    for j in range(1,k+1):
        if i < j:
            break
        if j < d:
            D[i][0] += D[i-j][0]
            D[i][1] += D[i-j][1]
            D[i][0] %= bignum
            D[i][1] %= bignum
        else:
            D[i][1] += D[i-j][0] + D[i-j][1]
            D[i][1] %= bignum
print(D[n][1])

n,k,d=map(int,input().split())

s1=[0]*110
s2=[0]*110
s1[0],s2[0]=1,1
mod = 10**9+7

for i in range(1,n+1):
    for j in range(1,k+1):
        if(j>i):
            break
        else:
            s1[i]+=s1[i-j]
    # print(s1[i])

    for j in range(1,d):
        if(j>i):
            break
        else:
            s2[i]+=s2[i-j]
print((s1[n]-s2[n])%mod)

n, k, d = map(int, raw_input().split())
dp = [[0 for i in range(2)] for j in range(n+1)]
dp[0][0] = 1
for v in range(1, n+1):
	for step in range(1, min(v, k)+1):
		dp[v][0] += dp[v-step][0]
		if step >= d:
			dp[v][1] += dp[v-step][0]
		else:
			dp[v][1] += dp[v-step][1]
print dp[n][1] % 1000000007

def solve(n, k, d):
    dp = []
    for i in range(n+1):
        dp.append([0]*(n+1))

    dp[0][0] = 1
    modulo = 1000000007
    for i in range(1, n+1):
        for j in range(1, k+1):
            if i-j < 0:
                break
            if j < d:
                dp[i][0] = (dp[i][0]+dp[i-j][0]) % modulo
                dp[i][1] = (dp[i][1]+dp[i-j][1]) % modulo
            else:
                dp[i][1] = (dp[i][1]+dp[i-j][0]) % modulo
                dp[i][1] = (dp[i][1]+dp[i-j][1]) % modulo

    return dp[n][1]

def main():
    n, k, d = list(map(int, input().split()))
    print(solve(n, k, d))

if __name__ == "__main__":
    main()

import random
import sys
Q = 10 ** 9 + 7
n, k, d = map(int, input().split())
dp = [0] * 105
dp1 = [0] * 105
dp[0] = 1
dp1[0] = 1
for i in range(1, n + 1):
    for j in range(max(0, i - k), i):
        dp[i] = (dp[i] + dp[j])
    for j in range(max(0, i - d + 1), i):
        dp1[i] = (dp1[i] + dp1[j])
print((dp[n] - dp1[n])% Q)

import functools
import sys

p = 10**9 + 7

line = input()
tokens = line.split()
n, k, d = int(tokens[0]), int(tokens[1]), int(tokens[2])

@functools.lru_cache(None)
def f(s):
    if s == 0:
        return 1

    total = 0
    for w in range(1, k + 1):
        if w > s:
            break
        total += f(s - w)
    return total % p

@functools.lru_cache(None)
def g(s):
    if s == 0:
        return 1
    total = 0
    for w in range(1, min(d, k + 1)):
        if w > s:
            break
        total += g(s - w)
    return total % p

print((f(n) - g(n)) % p)

'''#problem1
n=int(input())
price=[int(i) for i in input().split()]
q=int(input())
acc=[]
for i in range(q):
    k=int(input())
    acc.append(k)
price.sort()
def search(k,arr):
    l=0
    r=len(arr)-1
    ans=0
    while l<=r:
        mid=l+int((r-l)/2)
        if arr[mid]<=k:
            ans=mid+1
            l=mid+1
        else:
            r=mid-1
    return ans
for j in acc:
    a=search(j,price)
    print(a)'''

'''n=int(input())
nums=[int(i) for i in input().split()]
s=sum(nums)
ans=0
if s%3!=0:
    ans=0

else:
    s/=3
    cnt=[0]*(n)
    sum=0
    for i in range(n-1,-1,-1):
        sum+=nums[i]
        if sum==s:
            cnt[i]=1
    for j in range(n-2,-1,-1):
        cnt[j]+=cnt[j+1]
    sum=0
    k=0
    while k+2<n:
        sum+=nums[k]
        if sum==s:
            ans+=cnt[k+2]

        k+=1
print(ans)'''

n,k,d=[int(i) for i in input().split()]
ans=0
dp=[[0,0] for j in range(n+1)]
dp[0][0]=1
dp[0][1]=0
for i in range(1,n+1):
    for j in range(1,k+1):
        if i-j<0:
            break
        if j<d:
            dp[i][0]+=dp[i-j][0]
            dp[i][1]+=dp[i-j][1]
        else:
            dp[i][1]+=dp[i-j][0]
            dp[i][1]+=dp[i-j][1]
print(dp[n][1]%(10**9+7))

n,k,d=map(int,input().split())
l1=[0]
for i in range (1,n+1):
    if i<=k:
        l1.append(2**(i-1))
    else:
        l1.append(sum(l1[i-k:i]))
l2=[0]
for i in range (1,n+1):
    if i<=d-1:
        l2.append(2**(i-1))
    else:
        l2.append(sum(l2[i-d+1:i]))
print((l1[n]-l2[n])%(10**9+7))

n,k,d = map(int,input().split())
# n,k,d = 28,6,3
mod = 1000000007
memo = [[-1]*100 for i in range(n+1)]
def dp(nn,s):
	sum1 = 0
	if nn == 0:
		if(s == 0):
			return 0
		else:
			return 1
	if memo[nn][s] != -1:
		return memo[nn][s]
	for i in range(1,(min(k,nn)+1)):
		sum1 =(sum1%mod + dp(nn-i,1 if s == 1 or i>= d else 0) %mod)%mod
	memo[nn][s] = sum1
	return sum1
r = dp(n,0)
print(r)

# n,k,d = map(int,input().split())
# n, k, d = 28, 6, 3
# dp = [[-1] * 2 for i in range(n + 1)]
# MOD = 1000000007
# def calc(summ, x):
# 	ans = 0
# 	if (summ == 0 and x == 1):
# 		return 1
#
# 	if (summ == 0 and x == 0):
# 		return 0
#
# 	if (dp[summ][x] != -1):
# 		return dp[summ][x]
#
# 	for i in range(1, (min(n, k) + 1)):
# 		ans = (ans % MOD + (calc(summ - i, (1 if x == 1 or i >= d else 0))) % MOD) % MOD
#
# 	dp[summ][x] = ans
# 	return ans
#
#
# print(calc(n, 0))
# print(dp)

key = 1000000007
n, k, d = [int(i) for i in raw_input().split()]
dp = [[0, 0] for i in range(n + 1)]
dp[0][0] = 1
for i in range(1, n + 1):
	total = 0
	for j in range(1, min(d, i + 1)):
		total += (dp[i - j][0] % key)
	dp[i][0] = total
for i in range(1, n + 1):
	total = 0
	for j in range(1, min(d, i + 1)):
		total += (dp[i - j][1] % key)
	for j in range(d, min(i, k) + 1):
		total += ((dp[i - j][0] + dp[i - j][1]) % key)
	dp[i][1] = total
print dp[n][1] % key

rem=10**9+7
def help(n,k):
    arr=[1]*(n+1)
    arr[1]=1
    for i in range(1,n+1):
        s=0
        j=i
        while(j>0):
            if j<=k:
                s=(s+arr[i-j])%rem
            j-=1
        arr[i]=s%rem
    return arr
#n,k,d=map(int,raw_input().split())
def pun(n,p):
    #print p
    arr = [1] * (n + 1)
    arr[1] = 1
    for i in range(1, n + 1):
        s = 0
        j = i
        while (j > 0):
            if j <p:
                s = (s+arr[i - j])%rem
            j -= 1
        arr[i] = s%rem
    return arr
n,k,p=map(int,raw_input().split())
a=help(n,k)
b=pun(n,p)
#print a,b
print (a[n]-b[n])%rem

n,k,d=map(int,raw_input().split())
if n<d:
    print 0
else:
    dp=[[0,0] for i in range(n+1)]
    dp[0][0]=1
    for i in range(1,n+1):
        s=0
        for j in range(i-min(d-1,i),i):
            s+=dp[j][0]
        dp[i][0]=s
    for i in range(0,n+1):
        s=0
        for j in range(i-min(d-1,i),i):
            s+=dp[j][1]
        for l in range(i-min(k,i),i-d+1):
            s+=dp[l][1]+dp[l][0]
        dp[i][1]=s
    print dp[n][1]%(10**9+7)

n,k,d = map(int,raw_input().split())

def memo(f):
    cache = {}
    def _f(*args):
        try:
            return cache[args]
        except KeyError:
            result = f(*args)
            cache[args] = result
            return result
        except TypeError:
            return f(*args)
    _f.cache = cache
    return _f

@memo
def solve(n,k,d,d_flag=False):
    if (n < 0):
        return 0
    if (n==0 and d_flag):
        return 1
    ans = 0
    for i in xrange(1,k+1):
        if i >= d:
           ans += solve(n-i,k,d,True)
        else:
            ans += solve(n-i,k,d,d_flag)
    return ans

print solve(n,k,d)%1000000007

n, k, d = map(int, input().split())
M = 1000000007

def solve(n, k):
	if k == 0:
		return 0
	ans = [0] * (n + 1)
	for i in range(1, min(n + 1, k + 1)):
		ans[i] = 1
	for i in range(1, n + 1):
		ans[i] = sum(ans[max(1, i-k):i+1]) % M
	return ans[n]

print((solve(n, k) - solve(n, d - 1)) % M)

[n, k, d] = map(int, raw_input().split())

def F(n, x):
	f = [1] + [0] * n
	for i in range(1, n + 1):
		f[i] = sum(f[max(i - x, 0) : i])
	return f[n]

print (F(n, k) - F(n, d - 1)) % (10 ** 9 + 7)

n, k, d = map(int,input().split())
mod = 10**9 + 7
add = [0]*105; sub = [0]*105
add[0] = sub[0] = 1
for i in range(n+1):
    for p in range(min(n-i, k)):
        add[p+i+1] = (add[p+i+1] + add[i])%mod
    for q in range(min(n-i, d-1)):
        sub[q+i+1] = (sub[q+i+1] + sub[i])%mod
print((add[n] - sub[n] + mod)%mod)

"""Template for Python Competitive Programmers prepared by Mayank Chaudhary """

# to use the print and division function of Python3
from __future__ import division, print_function

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""use resource"""
# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])

"""for factorial"""

# def prepare_factorial():
#     fact = [1]
#     for i in range(1, 105):
#         fact.append((fact[-1] * i) % mod)
#     ifact = [0] * 105
#     ifact[104] = pow(fact[104], mod - 2, mod)
#     for i in range(104, 0, -1):
#         ifact[i - 1] = (i * ifact[i]) % mod
#
#     return fact, ifact

"""uncomment next 4 lines while doing recursion based question"""
# import threading
# threading.stack_size(1<<27)
import sys
# sys.setrecursionlimit(10000)

"""uncomment modules according to your need"""
# from bisect import bisect_left, bisect_right, insort
# import itertools
# from math import floor, ceil, sqrt, degrees, atan, pi
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from collections import Counter, defaultdict, deque
# from copy import deepcopy
'''
def modinv(n, p):
    return pow(n, p - 2, p)
'''

# def ncr(n, r,  fact, ifact):  # for using this uncomment the lines calculating fact and ifact
#     t = (fact[n] * (ifact[r]*ifact[n-r]) % mod)% mod
#     return t

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

# def GCD(x, y):
#     while (y):
#         x, y = y, x % y
#     return x
#
# def lcm(x, y):
#     return (x*y)//(GCD(x, y))

# def get_xor(n):
#     return [n,1,n+1,0][n%4]

# def binary_expo(a, b):
#
#     result = 1
#     while b:
#         if b&1:
#             result *= a
#             b-=1
#         else:
#             a *= a
#             b >>= 1
#     return result

"""*******************************************************"""

def solve(n, d, memo):

    if n==0:
        return 1
    if n<0:
        return 0
    if (n, d) in memo:
        return memo[(n, d)]

    ans = 0
    for i in range(1, d+1):
        ans += solve(n-i, d, memo)
        ans %= mod

    memo[(n, d)] = ans
    return memo[(n, d)]

def main():

    n, k, d = get_ints()

    memo = dict()
    ans1 = solve(n, k, memo)

    memo = dict()
    ans2 = solve(n, d-1, memo)

    print((ans1 - ans2 + mod)%mod)

""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip

    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

# Never use "None" to fill dp memory.
mod=10**9+7
path=[[-1]*2 for _ in range(101)]
def count(i,state):
    if path[i][state]!=-1: return path[i][state]
    if i==0: return state
    result=0
    for j in range(1,k+1):
        if i>=j:
            result=(result+count(i-j,[1,state][j<d]))%mod
    path[i][state]=result
    return path[i][state]

n,k,d=map(int,input().split())
print(count(n,0))

import random
import sys
Q = 10 ** 9 + 7
n, k, d = map(int, input().split())
dp = [0] * 105
dp1 = [0] * 105
dp[0] = 1
dp1[0] = 1
for i in range(1, n + 1):
    for j in range(max(0, i - k), i):
        dp[i] = (dp[i] + dp[j]) % Q
    for j in range(max(0, i - d + 1), i):
        dp1[i] = (dp1[i] + dp1[j]) % Q
print((dp[n] - dp1[n] + Q) % Q)

mod = 10**9+7
n, k, d = map(int, input().strip().split())
notD = [0 for i in range(n+1)]
notD[0] = 1
withD = [0 for i in range(n+1)]
withD[0] = 1

for i in range(n+1):
    for j in range(1, d):
        if i >= j:
            notD[i] += notD[i-j]

for i in range(n+1):
    for j in range(1, k+1):
        if i >= j:
            withD[i] += withD[i-j]

# print(withD)
# print(notD)
print((withD[n]-notD[n])%mod)

nums = map(int, raw_input('').split(' '))
n, k, d = nums[0], nums[1], nums[2]
ans = [(0, 0)] * 101

ans[0] = (0, 1)
for i in xrange(1, n + 1):
    num_contain = 0
    num_not_contain = 0
    for j in xrange(1, k + 1):
        if (i - j) >= 0:
            num_contain += ans[i - j][0]
            if j >= d:
                num_contain += ans[i - j][1]
            else:
                num_not_contain += ans[i - j][1]
    ans[i] = (num_contain, num_not_contain)
print ans[n][0] % 1000000007

m = 1e9 + 7

def add_mod(numb: int, ways: int) -> int:
    numb += ways
    if numb >= m:
        return int(numb % m)
    return numb

n, k, d = map(int, input().split())
a = [[0] * 2 for i in range(n + 1)]
a[0][0] = 1
for i in range(1, n + 1):
    for j in range(1, k + 1):
        if i - j < 0:
            break

        if j < d:
            a[i][0] = add_mod(a[i][0], a[i - j][0])
            a[i][1] = add_mod(a[i][1], a[i - j][1])
        else:
            a[i][1] = add_mod(a[i][1], a[i - j][0])
            a[i][1] = add_mod(a[i][1], a[i - j][1])

print(a[n][1])

import sys,math
from collections import deque

if __name__ == '__main__':
	[n,k,d] = map(int,raw_input().split())
	dp = [[0]*(500) for _ in range(500)]
	dp[0][0]=1;
	for i in range(100):
		for j in range(1,k+1):
			for m in range(2):
				#print dp[i+j][1]
				dp[i+j][m==1 or j>=d] += dp[i][m]
	print dp[n][1] % (10**9+7)

n, k, d = [int(i) for i in input().split(" ")]

dp = [ [0 for i in range(2)] for j in range(105)]
dp[0][0] = 1
for i in range(n+1):
    for j in range(i-1, -1,-1):
        if i-j>k:
            break
        if i-j<d:
            dp[i][0] += dp[j][0]
            dp[i][1] += dp[j][1]
        if i-j>=d and i-j<=k:
            dp[i][1] += dp[j][0]+dp[j][1]
print(dp[n][1] % (10**9 + 7))

#                                               |
#   _` |  __ \    _` |   __|   _ \   __ \    _` |   _` |
#  (   |  |   |  (   |  (     (   |  |   |  (   |  (   |
# \__,_| _|  _| \__,_| \___| \___/  _|  _| \__,_| \__,_|

import sys
import math
import operator as op
from functools import reduce

## I/O ##
def read_line():
    return sys.stdin.readline()[:-1]

def read_int():
    return int(sys.stdin.readline())

def read_int_line():
    return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
    return [float(v) for v in sys.stdin.readline().split()]
## ##

## ncr ##
def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
## ##

## Fenwick Tree ##
N = int(1e6)+10
fenwick = [0]*N

def add(i,x,n):
	while i<n:
		fenwick[i]+=x
		i = i|(i+1)

def fsum(i,n):
	res = 0
	while i>=0:
		res += fenwick[i]
		i = (i&(i+1))-1
	return res

def fsum_range(i,j,n):
	return fsum(j,n)-fsum(i-1,n)
## ##

## Main ##

mod = int(1e9)+7

# t = read_int()
t = 1
for i in range(t):
	n, k, d = read_int_line()
	dp = [[0,0] for i in range(n+1)]
	dp[0][0] = 1
	dp[0][1] = 0
	for i in range(1,n+1):
		for j in range(1,min(d-1,i)+1):
			dp[i][0] += dp[i-j][0]
		for j in range(1,min(d-1,i)+1):
			dp[i][1] += dp[i-j][1]
		for j in range(d,min(k,i)+1):
			dp[i][1] += (dp[i-j][0]+dp[i-j][1])

	print(dp[n][1]%mod)

inputs = [int(x) for x in input().split()]

desired_weight = inputs[0]
k = inputs[1]
min_weight = inputs[2]

# desired_weight = 38
# k = 16
# min_weight = 15
#

# desired_weight = 3
# k = 3
# min_weight = 3

saved = [{True: None, False: None} for i in range(desired_weight + 1)]
saved[desired_weight] = {True: 0, False: 0}

modulo = 1000000007

for i in reversed(range(0, desired_weight)):
#     print('*** ' + str(i) + ' ***')
    range_to_work_with = i + k
    hit_min_value = 0
    fail_to_hit_min_value = 0

    travel_range = range(i + 1, i + k + 1 if i + k + 1 <= desired_weight + 1 else desired_weight + 1)
#     print(travel_range)
    for j in travel_range:
        if j - i >= min_weight:
            fail_to_hit_min_value += saved[j][True]
        else:
            fail_to_hit_min_value += saved[j][False]
    fail_to_hit_min_value += 1 if desired_weight - i <= k and desired_weight - i >= min_weight else 0

    for j in travel_range:
        hit_min_value += saved[j][True]
    hit_min_value += 1 if desired_weight - i <= k else 0

    saved[i][True] = hit_min_value
    saved[i][False] = fail_to_hit_min_value

# print(saved)
print(saved[0][False] % modulo)

def main():
    n, k, d = map(int, raw_input().split())
    mod = 10 ** 9 + 7
    dp = [[0] * 201, [0] * 201]
    dp[0][0] = 1
    ans = 0
    for i in xrange(n):
        ndp = [[0] * 201, [0] * 201]
        for j in xrange(1, d):
            for l in xrange(n):
                for b in [0, 1]:
                    ndp[b][l+j] += dp[b][l]
                    if ndp[b][l+j] >= mod:
                        ndp[b][l+j] -= mod
        for j in xrange(d, k+1):
            for l in xrange(n):
                ndp[1][l+j] += dp[0][l] + dp[1][l]
                if ndp[1][l+j] >= mod:
                    ndp[1][l+j] -= mod
                if ndp[1][l+j] >= mod:
                    ndp[1][l+j] -= mod
        dp = ndp
        ans += dp[1][n]
        if ans >= mod:
            ans -= mod
    print ans
main()

n,k,d=map(int,input().strip().split(' '))
dp=[0]*(n+k+1)
vp=[0]*(n+k+1)
for i in range(1,n+1):
    for j in range(1,k+1):
        dp[i]+=dp[i-j]
        if j>=d:
            continue
        else:
            vp[i]+=vp[i-j]
    if i<=k:
        dp[i]+=1
        if i>=d:
            continue
        else:
            vp[i]+=1
print((dp[n]-vp[n])%(10**9 + 7))

(n, k, d) = map(int, input().split(' '))

dp = [[-1 for i in range(202)] for j in range(2002)]

mod = int(1000000007)

def f(_sum, ok):
    if dp[_sum][ok] == -1 and _sum < n:
        ans = 0
        for i in range(1, k + 1):
            if ok == 0 and i >= d:
                ans += f(_sum + i, 1)
            else:
                ans += f(_sum + i, ok)
            ans = ans % mod
        dp[_sum][ok] = ans
        return ans

    if dp[_sum][ok] != -1 and _sum < n:
        return dp[_sum][ok]

    if _sum == n and ok == 1:
        dp[_sum][ok] = 1

    if _sum > n:
        dp[_sum][ok] = 0

    if _sum == n and ok == 0:
        dp[_sum][ok] = 0

    return dp[_sum][ok]

print(f(0, 0))

n,k,d = map(int,input().split())

mod = 10**9 + 7
memo = {}

def DFS(hasD = False, totalSum=n):

    global memo
    c=0
    startD = hasD

    for i in range(1,k+1):

        hasD = startD
        if i >= d:
            hasD = True

        if totalSum - i == 0:
            if hasD:
                c+=1
            break

        if (hasD,totalSum-i) not in memo:
            memo[(hasD,totalSum-i)]=DFS(hasD,totalSum-i)
        c+=memo[(hasD,totalSum-i)]

    return c%mod

print(DFS())

import sys

inf = float("inf")
# sys.setrecursionlimit(10000000)

# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod, MOD = 1000000007, 998244353
# vow=['a','e','i','o','u']
# dx,dy=[-1,1,0,0],[0,0,1,-1]

# from collections import deque, Counter, OrderedDict,defaultdict
# from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
# from math import ceil,floor,log,sqrt,factorial
# from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right

def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

n,k,d = get_ints()
w = [0]*(n+1)
wot = [0]*(n+1)

for i in range(1,n+1):
    if i<=k:
        w[i] = 1
        if i<d:
            wot[i] = 1

for i in range(1,n+1):
    for j in range(1,k+1):
        if i<j:
            continue
        w[i] = (w[i] + w[i-j])%mod
        if j<d:
            wot[i] = (wot[i] + wot[i-j])%mod
print((w[n]-wot[n]+mod)%mod)

import functools
import sys

p = 10**9 + 7

line = input()
tokens = line.split()
n, k, d = int(tokens[0]), int(tokens[1]), int(tokens[2])

f = [None] * (n + 1)
for i in range(len(f)):
    f[i] = [0] * 2

f[0][0] = 0
f[0][1] = 1
for s in range(1, n + 1):
    for w in range(1, min(s, k) + 1):
        f[s][1] = (f[s][1] % p + f[s-w][1] % p) % p
        f[s][0] = (f[s][0] % p + f[s-w][1 if w >= d else 0] % p) % p
print(f[n][0])

# h() is the top-down recursive approach to f
@functools.lru_cache(None)
def h(s, e):
    if s == 0:
        return 1 if e else 0

    # e is True if there exists some edge with weight at least d
    total = 0
    for w in range(1, min(s, k) + 1):
        total += h(s - w, e or w >= d)
    return total % p

#print(h(n, False))

# Or we could define f(s) to be the number of paths with total weight s without
# any restriction on the edge weight. And define g(s) to be only those with edge
# weight < d. Then the answer is f(s) - g(s)
@functools.lru_cache(None)
def f(s):
    if s == 0:
        return 1

    total = 0
    for w in range(1, k + 1):
        if w > s:
            break
        total += f(s - w)
    return total % p

@functools.lru_cache(None)
def g(s):
    if s == 0:
        return 1
    total = 0
    for w in range(1, min(d, k + 1)):
        if w > s:
            break
        total += g(s - w)
    return total % p

#print((f(n) - g(n)) % p)

from sys import stdin

def calculate_main(n, k, mod):
	dp = [0] *(n + 1)
	dp[0] = 1; dp[1] = 1
	for i in range(2, n + 1):
		for j in range(i - 1, max(- 1, i - k - 1), - 1):
			dp[i] += dp[j]
			dp[i] %= mod

	return dp

# main starts
n, k, d = list(map(int, stdin.readline().split()))
mod = 10 ** 9 + 7
dp = calculate_main(n, k, mod)
#print(dp)
dp2 = [0] * (n + 1)

for i in range(d, n + 1):
	for j in range(1, min(k + 1, i + 1)):
		if  j < d:
			dp2[i ] += dp2[i - j]
			dp2[i ] %= mod
		else:
			dp2[i] += dp[i - j]
			dp2[i] %= mod
#print(dp2)

print((dp2[n])% mod)

n, k, d = map(int, input().split())
v = [1] #all
for i in range(1,n+1):
    s = 0
    for j in range(max(0, i-k),i):
        s += v[j]
    v.append(s)
a = [1] #except
for i in range(1,n+1):
    s = 0
    for j in range(max(0,i-d+1),i):
        s+=a[j]
    a.append(s)
print((v[len(v)-1]-a[len(a)-1])%1000000007)

n, k, d = map(int, input().split())
a = [1]
b = [0]
for i in range(1, n + 1):
    a.append(sum(a[max(i - d + 1, 0):]))
    b.append(sum(a[max(i - k, 0):max(i - d + 1, 0)]) + sum(b[max(i - k, 0):]))
print(b[n] % (10**9+7))

n, k, d = map(int, input().split())
N = 10 ** 9 + 7
matrix = [[0 for x1 in range(k + 1)] for x2 in range(n + 1)]
matrix[0][0] = 1

for s in range(0, n):
    for l in range(1, k + 1):
        if s + l > n:
            break
        for ml in range(0, k + 1):
            matrix[s + l][max(ml, l)] += matrix[s][ml]
            matrix[s + l][max(ml, l)] %= N

print(sum(matrix[-1][d:]) % N)

def dp(n,k,d,f,m):

    if (n == 0):
        if (f == True):
            return 1
        return 0
    if (n < 0):
        return 0
    if (m[n][f] != -1):
        return m[n][f]

    res = 0

    for i in range(1,k+1):
        if (i >= d):
            res += dp(n-i,k,d,f | True,m)
        else:
            res += dp(n-i,k,d,f | False,m)

    m[n][f] = res % 1000000007

    return m[n][f]

if __name__ == '__main__':
    n, k, d = [int(x) for x in input().split()]
    m = [[-1,-1] for _ in range(n+1)]
    print(dp(n,k,d,False,m))

I=lambda : list(map(int,input().split(' ')))
def path(total,num):
    if total in mem:
        return mem[total]
    if total==0:
        return 1
    else:
        mem[total]=0
        for i in range(1,num+1):
            if total-i>=0:
                mem[total]+=path(total-i,num)
            else:
                break
        return mem[total]

def ans(n,k,d):
    global mem
    mem={}
    a=path(n,k)
    if d>1:
        mem={}
        b=path(n,d-1)
    else:
        b=0
    return a-b
n,k,d=I()
print(ans(n,k,d)%int(10**9+7))

x=map(int,raw_input().split(' '))
path=x[0]
tree=x[1]
d=x[2]
dp=[[0 for x in range(2)] for x in range(200)]
dp[0][1]=1
dp[0][0]=1
for i in range(1,path+1):
    for j in range(1,min(tree,d-1)+1):
        if i<j:
            break
        dp[i][0]+=dp[i-j][0]

for i in range(1,path+1):
    for j in range(1,tree+1):
        if i<j:
            break
        dp[i][1]+=dp[i-j][1]
ans = dp[path][1]-dp[path][0]
ans%=(1000000007)
print(ans)

import sys
input=sys.stdin.readline

n,k,d=map(int,input().split())
dp=[[0,0] for i in range(n+1)]
dp[0][0]=1
mod=10**9+7
for i in range(1,n+1):
    for j in range(1,min(i+1,k+1)):
        if j<d:
            dp[i][0]+=dp[i-j][0]
        if j>=d:
                dp[i][1]+=dp[i-j][0]+dp[i-j][1]
        else:
            dp[i][1]+=dp[i-j][1]
        dp[i][0]%=mod
        dp[i][1]%=mod
print(dp[n][1])

import random
import sys
Q = 10 ** 9 + 7
n, k, d = map(int, input().split())
dp = [0] * 105
dp1 = [0] * 105
dp[0] = 1
dp1[0] = 1
for i in range(1, n + 1):
    for j in range(max(0, i - k), i):
        dp[i] = (dp[i] + dp[j]) % Q
    for j in range(max(0, i - d + 1), i):
        dp1[i] = (dp1[i] + dp1[j]) % Q
print((dp[n] - dp1[n] + Q) % Q)

input_ = list(map(int,input().split()))
n, k ,d  = input_[0], input_[1], input_[2]

'''
def opt_tree(n,k,d):
	if d > n or n <= 0:
		return 0
	if n == 1 :
		return 1
	if d == n:
		return 1
	return  sum([opt_tree(n-i, k, (d-i)*(i>=d) + d*(i<d) ) for i in range(1,k+1)]) + (n<=k)
'''

dp = [['None' for i in range(d+1)] for j in range(n+1) ]

#Initialize
for j in range(d+1):
	#case 1
	dp[0][j] = 0

	for i in range(n+1):
		if j > i :
			dp[i][j] = 0
	#case 2
	if dp[1][j] == 'None':
		dp[1][j] = 1
	# case 3
	for i in range(min(d+1,n+1)):
		if dp[i][i] == 'None':
			dp[i][i] = 1

#main step
for n_temp in range(1,n+1):
	for d_temp in range(d+1):
		if dp[n_temp][d_temp] == 'None':
			dp[n_temp][d_temp] = sum([dp[n_temp -i][((d_temp-i)*(i>=d_temp) + d_temp*(i<d_temp))*(((d_temp-i)*(i>=d_temp) + d_temp*(i<d_temp))>=0)] for i in range(1,min([k+1,n_temp+1]))] ) + (n_temp <= k)

print(dp[n][d]%(10**9+7))

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    for i in range (1, min(N, K)+1):
        a[i] = sum (a[0:i])
    if N > K:
        for x in range(K+1,N+1):
            a[x] = sum(a[x-K: x])
    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = (w(n, k)-w(n, g-1)) % (10**9+7)
    print(result)

sol()

MOD = 10 ** 9 + 7
HAVE, NOT_HAVE = 1, 0

n, k, d = map(int, input().split())

dp = [[0 for _ in range(n + 1)] for _ in range(2)]
dp[NOT_HAVE][0] = 1
for dist in range(1, n + 1):
    for weight in range(1, k + 1):
        if weight > dist:
            break
        if weight >= d:
            dp[HAVE][dist] += dp[HAVE][dist - weight] + dp[NOT_HAVE][dist - weight]
            dp[HAVE][dist] %= MOD
        else:
            dp[NOT_HAVE][dist] += dp[NOT_HAVE][dist - weight]
            dp[NOT_HAVE][dist] %= MOD
            dp[HAVE][dist] += dp[HAVE][dist - weight]
            dp[HAVE][dist] %= MOD
print(dp[HAVE][n])

n,k,d=map(int,input().split())
dp=[[0 for i in range(2)] for i in range(101)]
dp[0][0]=1
dp[0][1]=1
for i in range(1,101):

        dp[i][0]=sum(dp[j][0] for j in range(i-min(i,d),i))
        if(min(i,d)==d):
            dp[i][0]=dp[i][0]-dp[i-d][0]

        dp[i][1]=sum(dp[j][1] for j in range(i-min(i,k),i))

pri=10**9+7
print((dp[n][1]-dp[n][0])%(pri))

def count(b,n):
    a = [0]*(n+1)
    m = len(b)
    a[0]=1
    for i in range(1,n+1):
        for j in range(m):
            if(i>=b[j]):
                a[i]+=a[i-b[j]]
    return a[n]
n,k,d = list(map(int,input().split()))
a = [i for i in range(1,k+1)]
b = [i for i in range(1,d)]
print((count(a,n)-count(b,n))%(10**9+7))

nums = map(int, raw_input('').split(' '))
n, k, d = nums[0], nums[1], nums[2]
ans = [(0, 0)] * 101

ans[0] = (0, 1)
for i in xrange(1, n + 1):
    num_contain = 0
    num_not_contain = 0
    for j in xrange(1, k + 1):
        if (i - j) >= 0:
            num_contain += ans[i - j][0]
            if j >= d:
                num_contain += ans[i - j][1]
            else:
                num_not_contain += ans[i - j][1]
    ans[i] = (num_contain, num_not_contain)
print ans[n][0] % 1000000007

[n, k, d] = map(int, raw_input().split())

def F(n, x):
	f = [1] + [0] * n
	for i in range(1, n + 1):
		f[i] = sum(f[max(i - x, 0) : i])
	return f[n]

print (F(n, k) - F(n, d - 1)) % (10 ** 9 + 7)

import functools

_MODER = 1000000007

def solve(n, k, d):
    @functools.lru_cache(None)
    def find_not_yet_d(n):
        if n < d:
            return 0

        r = 0
        for i in range(1, min(n, k) + 1):
            if i >= d:
                r += find_used_d(n - i)
            else:
                r += find_not_yet_d(n - i)
        return r % _MODER

    @functools.lru_cache(None)
    def find_used_d(n):
        if n == 0:
            return 1
        r = 0
        for i in range(1, min(n, k) + 1):
            r += find_used_d(n - i)
        return r % _MODER

    return find_not_yet_d(n) % _MODER

n, k, d = map(int, input().split())
print(solve(n, k, d))

import sys
sys.setrecursionlimit(2 ** 20)

n, k, d = map(int, raw_input().split())
ways = 0

dp = [ [ -1 for y in xrange(2) ] for x in xrange(n+1) ]

def getWays(total = 0, got = 0):
    global ways, n, k, d, dp

    if total > n :
        return 0

    if total == n :
        return got

    if dp[total][got] != -1 :
        return dp[total][got]

    dp[total][got] = 0

    for i in xrange(1, k+1):
        if i >= d :
            dp[total][got] += getWays(total + i, 1)
        else :
            dp[total][got] += getWays(total + i, got)

    return dp[total][got]

print getWays() % 1000000007

import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log, pi, sin
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

@lru_cache(None)
def recur(number, flag=False):
    if number > n:
        return 0
    if number == n:
        return int(flag)
    answer = 0
    for temp in arr:
        answer += recur(number + temp, flag or (temp >= d))
        if answer > mod:
            answer -= mod
    return answer % mod

n, k, d = sp()
arr = []
for i in range(1, k+1):
    arr.append(i)
out(recur(0))

import sys
import collections
import math
import functools
import itertools
import bisect
import operator
import heapq
import random
true=True
false=False
null=None
SLOW=True
memoi=functools.lru_cache(None)
tcid=0
tcmax=99999999
def fast(): SLOW=False
def compute(val, func): return func(val)
def seq(lo,hi,step=1):
 return range(lo,hi+1,step)
def sround(val,nd):
 return f'{val:.{nd}f}'
def ceil(a,b):
 ans=a//b
 if a%b!=0: ans+=1
 return ans
def perr(*args,**kwargs):
 if SLOW:
  print(*args,file=sys.stderr,**kwargs)
def line():
 ln=sys.stdin.readline().strip()
 #perr(ln)
 if ln=='': sys.exit()
 return ln
def lines(n): return [line() for i in range(n)]
def split(ln=None): return (ln or line()).split()
def num(str=None):
 str=str or line()
 return float(str) if '.' in str else int(str)
def nums(o=None):
 if o is not None:
  if isinstance(o, int): o=lines(o)
  elif isinstance(o, str): o=split(o)
 return list(map(num, o or split()))
"""
ceil(a,b) sround(val,nd) true false null @memoi
num(?) nums(?) split(?) lines(n) line()
perr(print) tcmax seq() compute(v,f) tcid fast()
"""
#{#

#}#
def mainloop(tcid=1):
# {{{
 n,k,d=nums()
 @memoi
 def aaa(nn,dd=false):
  if nn==0:
   return int(dd)
  ans=0
  for xx in seq(1,min(nn,k)):
   aa=aaa(nn-xx,dd or xx>=d)
   ans=(ans+aa)%(10**9+7)
  return ans
 ans=aaa(n)
 print(ans)
# }}}
while tcid<tcmax:
 tcid+=1
 mainloop(tcid)
"""

"""

def check(n,k):
    if k==0:
        return 0
    dp = [0]*(n+1)
    dp[0]=1
    cur = 0
    sub = 0
    su = 1
    # print dp[0]
    for i in range(1,n+1):
        dp[i] = su
        su+=dp[i]
        if i >= k:
            sub=dp[cur]
            cur+=1
            su-=sub
        # print dp[i],i,su
    return dp[n]

n,k,d = map(int,raw_input().split(' '))
print (check(n,k)-check(n,d-1))%1000000007

n,k,d = input().split()
n,k,d = int(n),int(k),int(d)

ans1 = [0 for _ in range(101)]
ans1[0] = 1

ans = [0 for _ in range(101)]
for i in range(d):
    ans[i] = 0

for i in range(0,n + 1):
    j = 1
    while j <= k and i - j >= 0:
        ans1[i] += ans1[i - j]
        j += 1

for i in range(d,n + 1):
    j = 1
    while j <= k and i - j >= 0:
        if j >= d:
            ans[i] += ans1[i - j]
        else: ans[i] += ans[i - j]
        j += 1
print(ans[n] % 1000000007)

n, k, d = input().split()

n = int(n)
k = int(k)
d = int(d)

dp = [[0 for i in range(n + 1)] for j in range(k + 1)]

for i in range(k + 1):
    dp[i][0] = 1

for j in range(1, n + 1):
    for i in range(1, k + 1):
        dp[i][j] = sum(dp[i][max(0, j - i):j + 1])

print((dp[k][n] - dp[d - 1][n])%(10**9 + 7))

n, k, d = map(int, input().split())

a = [1]
b = [0]
for i in range(1, n + 1):
    a.append(sum(a[max(i - d + 1, 0):]))
    b.append(sum(a[max(i - k, 0):max(i - d + 1, 0)]) + sum(b[max(i - k, 0):]))
    #print (a)
    #print (b)
print(b[n] % (10**9+7))

n, k, d = map(int, input().split())
b=10**9+7
ways = [0] * (n + 1)
ways.insert(0, 0)
j = 1
s = 0
while (j <= min(k,n)):
    ways[j] = 1
    j += 1
s += ways[n]
for i in range(2, n + 1):
    new_ways = [0] * (n + 1)
    for j in range(1, n + 1):
        for p in range(1, k + 1):
            if (j + p) <= n:
                new_ways[j + p] += ways[j]
    ways = []
    for j in new_ways:
        ways.append(j)
    s += (ways[n])
    s=s%b
ways = [0] * (n + 1)
ways.insert(0, 0)
j = 1
r = 0
while (j <= min(d-1,n)):
    ways[j] = 1
    j += 1
r += ways[n]
for i in range(2, n + 1):
    new_ways = [0] * (n + 1)
    for j in range(1, n + 1):
        for p in range(1, d):
            if (j + p) <= n:
                new_ways[j + p] += ways[j]
    ways = []
    for j in new_ways:
        ways.append(j)
    r += (ways[n])
    r=r%b

print((s - r)%b)

n, k, d = map(int, input().split())
M = 1000000007
a = [1] + [0] * n
for i in range(1, n + 1):
  for j in range(max(0, i - k), i):
    a[i] = (a[i] + a[j]) % M
# print(a)
b = [1] + [0] * n
for i in range(1, n + 1):
  for j in range(max(0, i - d + 1), i):
    b[i] = (b[i] + b[j]) % M
# print(b)
print((a[n] - b[n]) % M)

n, k, d = map(int, raw_input().split(' '))

def different_paths(n, k, d):
    M = 1000000007
    cache = {}
    if d > k:
        return 0

    def find(n, flag):
        if n < 0:
            return 0
        elif n == 0:
            return 0 if flag else 1
        elif (n, flag) in cache:
            return cache[(n, flag)]
        else:
            s = 0
            if not flag:
                s = sum([find(n - i, False) for i in range(1, k + 1)])
            else:
                for i in range(1, d):
                    s += find(n - i, True)
                for i in range(d, k + 1):
                    s += find(n - i, False)
            cache[(n, flag)] = s
            return s

    return find(n, True) % M

print different_paths(n, k, d)

dp = [0] * 101
dpx = [0] * 101

n,k,d = input().split()
n = int(n)
k = int(k)
d = int(d)

dp[0] = 1 ;
dpx[0] = 1 ;

for i in range(1,n+1):
    #print(i)
    for j in range(1, min(i,k) + 1):
        dp[i] = dp[i] + dp[i - j]

for i in range(1,n+1):
    for j in range(1, min(i,d-1) + 1):
        dpx[i] = dpx[i] + dpx[i - j]

print((dp[n] - dpx[n]) % 1000000007)

import sys,math
from collections import deque

if __name__ == '__main__':
	[n,k,d] = map(int,raw_input().split())
	dp = [[0]*(500) for _ in range(500)]
	dp[0][0]=1;
	for i in range(100):
		for j in range(1,k+1):
			for m in range(2):
				#print dp[i+j][1]
				dp[i+j][m==1 or j>=d] += dp[i][m]
	print dp[n][1] % (10**9+7)

def tree(k, n):
    tab = [[0 for _ in xrange(k + 1)] for _ in xrange(n + 1)]
    for i in xrange(0, k + 1):
        tab[0][i] = 1
    for i in xrange(1, n + 1):
        tab[i][0] = 0
        for j in xrange(1, k + 1):
            if (i < j):
                tab[i][j] = tab[i][j - 1]
            else:
                tab[i][j] = (tab[i][j - 1] + tab[i - j][k]) % modulo
    return tab[n][k]

n, k, d = map(int, raw_input().split())
modulo = 1000000007

if (d < 2):
  print tree(k, n)
else:
  print (tree(k, n) - tree(d - 1, n)) % modulo

mod = 10**9+7

def countWays(arr, m, N,d):
    count = [0 for i in range(N + 1)]
    count[0] = 1
    for i in range(1, N + 1):
        for j in range(m):
            if (i >= arr[j]) and arr[j]<d:
                count[i] += count[i - arr[j]]
            count[i]%=mod
    return count[N]

def countWays1(arr, m, N):
    count = [0 for i in range(N + 1)]
    count[0] = 1
    for i in range(1, N + 1):
        for j in range(m):
            if (i >= arr[j]):
                count[i] += count[i - arr[j]]
        count[i]%=mod
    return count[N]
n,k,d = map(int,input().split())
a = [i for i in range(1,k+1)]
t1  = countWays(a,len(a),n,d)
t2 = countWays1(a,len(a),n)
print((t2-t1+mod)%mod)

n, k, d = map(int, input().split())
done = {}

def num_pos(i, d_in):
    if (i, d_in) in done:
        return done[(i, d_in)]
    if i == 0 and d_in:
        return 1
    if i == 0:
        return 0
    pos = 0
    for v in range(1, k+1):
        if v > i:
            break
        pos += num_pos(i - v, d_in or v >= d)
    done[(i, d_in)] = pos
    return pos

print(num_pos(n, False) % 1000000007)

import sys
input = sys.stdin.readline
read_tuple = lambda _type: map(_type, input().split(' '))

def solve():
    n, k, d = read_tuple(int)
    edges = [i for i in range(1, k + 1)]
    cnt_normal = [0 for _ in range(n + 1)]
    cnt_d = [0 for _ in range(n + 1)]
    for i in range(1, n + 1):
        for edge in edges:
            if i == edge:
                cnt_normal[i] += 1
                if edge < d:
                    cnt_d[i] += 1
            if i - edge >= 0:
                cnt_normal[i] += cnt_normal[i - edge]
                if edge < d:
                    cnt_d[i] += cnt_d[i - edge]
    print((cnt_normal[n] - cnt_d[n]) % 1000000007)

if __name__ == '__main__':
    solve()

import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

mod = 10**9+7

n,k,d = RI()
n += 1
dp0,dp1 = [0]*n,[0]*n
dp0[0] = 1

for i in xrange(1,n):
    for j in xrange(1,min(i,k)+1):
        if j<d: dp0[i] += dp0[i-j]
        else: dp1[i] += dp0[i-j]
        dp1[i] += dp1[i-j]
        dp0[i] %= mod
        dp1[i] %= mod

print dp1[-1]

N = 105

dp = [[0 for _1 in range(N)] for _2 in range(N)]
mod = 1000000007

def read():
    return map(int, raw_input().strip().split())

def main():
    n, k, d = read()
    dp[0][0] = 1
    for i in range(1, n+1):
        for j in range(1, min(d-1, i)+1):
            #print i, i-j
            dp[i][0] += dp[i-j][0]
         #   if dp[i][0] >= mod: dp[i][0] %= mod
            dp[i][1] += dp[i-j][1]
       #     if dp[i][1] >= mod: dp[i][1] %= mod
        for j in range(d, min(i, k)+1):
            dp[i][1] += (dp[i-j][0] + dp[i-j][1])
        #    if dp[i][1] >= mod: dp[i][1] %= mod

    print dp[n][1] % mod

if __name__ == "__main__":
    main()

#!/usr/bin/python

def memoize(f):
    cache= {}
    def memf(*x):
        if x not in cache:
            cache[x] = f(*x)
        return cache[x]
    return memf

import sys

def Ni(): return tuple(map(int, sys.stdin.readline().split()))
def Ns(): return tuple(map(int, sys.stdin.readline().split()))

n, k, d = Ni()
M = 10**9 + 7

@memoize
def count(n, haveD):
    #print n, haveD
    if n == 0:
        if haveD:
            return 1
        else:
            return 0

    s = 0
    for i in range(1, min(n, k) + 1):
        s = (s + count(n - i, haveD or i >= d)) % M

    return s

print count(n, False)

import sys
input = sys.stdin.buffer.readline
def I(): return(list(map(int,input().split())))
def sieve(n):
	a=[1]*n
	for i in range(2,n):
	    if a[i]:
	        for j in range(i*i,n,i):
	            a[j]=0
	return a
MOD = 10**9 + 7
def rec(s,f):
	if s<0:
		return 0
	if s==0:
		if f==1:
			return 0
		else:
			return 1
	ans = 0
	if dp[s][f]!=-1:
		return dp[s][f]
	for i in range(1,k+1):
		if i<d:
			ans += rec(s-i,f)
		else:
			ans +=rec(s-i,0)
		ans%=MOD
	dp[s][f]=ans
	return ans

n,k,d=I()
dp = [[-1,-1] for i in range(n+1)]

for i in range(n+1):
	rec(i,0)
	rec(i,1)
print(rec(n,1))

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[x-K: x])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g-1)
    print(result)

sol()

n, k, d = map(int, input().split())
f, g, d = [0] * (n + 1), [1] * (n + 1), 1 - d
for i in range(1, n + 1):
    f[i] = sum(g[j] for j in range(max(0, i - k), d + i)) + sum(f[j] for j in range(max(0, d + i), i))
    g[i] = sum(g[j] for j in range(max(0, i - k), i))
print(f[n])

n, k, d = map(int, input().split())
v = [1] #all
for i in range(1,n+1):
    s = 0
    for j in range(max(0, i-k),i):
        s += v[j]
    v.append(s)
a = [1] #except
for i in range(1,n+1):
    s = 0
    for j in range(max(0,i-d+1),i):
        s+=a[j]
    a.append(s)
print(v[len(v)-1]-a[len(a)-1])

n,v,d=list(map(int,input().split()))
dp=[[0]*2 for i in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for k in range(1,min(i,v)+1):
        dp[i][0]+=dp[i-k][0]
        if k>=d:
            dp[i][1]+=dp[i-k][0]
        else:
            dp[i][1]+=dp[i-k][1]
print(dp[n][1])

rem=10**9+7
def help(n,k):
    arr=[1]*(n+1)
    arr[1]=1
    for i in range(2,n+1):
        s=0
        j=i
        while(j>0):
            if j<=k:
                s=(s+arr[i-j])%rem
            j-=1
        arr[i]=s%rem
    return arr
#n,k,d=map(int,raw_input().split())
def pun(n,p):
    #print p
    arr = [1] * (n + 1)
    arr[1] = 1
    for i in range(2, n + 1):
        s = 0
        j = i
        while (j > 0):
            if j <p:
                s = (s+arr[i - j])%rem
            j -= 1
        arr[i] = s%rem
    return arr
n,k,p=map(int,raw_input().split())
a=help(n,k)
b=pun(n,p)
#print a,b
print (a[n]-b[n])%rem

N = 105

dp = [[[0 for _1 in range(N)] for _2 in range(N)] for _3 in range(N)]
mod = 1000000007

def read():
    return map(int, raw_input().strip().split())

def main():
    n, m, d = read()
    for i in range(1, m+1):
        dp[1][i][i] = 1
    for i in range(1, N-1):
        for j in range(1, n+1):
            for k in range(1, m+1):
                if dp[i][j][k] != 0:
                    for p in range(1, k):
                        if j+p > n: continue
                        dp[i+1][j+p][k] += dp[i][j][k]
                        if dp[i+1][j+p][k] >= mod: dp[i+1][j+p][k] %= mod
                    for p in range(k, m+1):
                        if j+p > n: continue
                        dp[i+1][j+p][p] += dp[i][j][k]
                        if dp[i+1][j+p][k] >= mod: dp[i+1][j+p][p] %= mod

    sum = 0
    #print dp[2][n][3]
    for i in range(1, N):
        for j in range(d, m+1):
            sum += dp[i][n][j]
            if sum >= mod: sum %= dp[i][n][j]
    print sum % mod

if __name__ == "__main__":
    main()

n, k, d = map(int, raw_input().split())
a = [1]
b = [0]
for i in range(n):
        b.append(sum(a[-k:1-d]) + sum(b[1-d:]))
        a.append(sum(a[-k:]))
print b[n]

# python3

##=====================================================
from sys import stdin, stdout
from collections import defaultdict, Counter
from functools import lru_cache
from math import gcd, floor, ceil

def ilist():
    return [int(x) for x in stdin.readline().strip().split(" ")]
def iint():
    return int(stdin.readline().strip())
def istr():
    return stdin.readline().strip()
##=====================================================

# Return the number of ways to get n using 1, 2, ..., k.
def solve(n, k):
    dp = [0] * (n + 1)
    dp[0] = 1
    dp[1] = 1
    for i in range(2, n+1):
        for j in range(1, k+1):
            if i-j >= 0:
                dp[i] += dp[i-j]
    return dp[n]

if __name__ == '__main__':
    n, k, d = ilist()
    print((solve(n, k) - solve(n, d-1)) % 1000_000_007)

import sys
sys.setrecursionlimit(999999999)
def solve(n,k,d,flag):
    if (n,k,d,flag) in dp:
        return dp[(n,k,d,flag)]
    if n==0:
        if flag:
            dp[(n,k,d,flag)]=1
        else:
            dp[(n,k,d,flag)]=0
    else:
        dp[(n,k,d,flag)]=0
        if flag:
            for i in xrange(1,k+1):
                if n-i>=0:
                    dp[(n,k,d,flag)]+=solve(n-i,k,d,flag)
        else:
            for i in xrange(1,d):
                if n-i>=0:
                    dp[(n,k,d,flag)]+=solve(n-i,k,d,False)
            for i in xrange(d,k+1):
                if n-i>=0:
                    dp[(n,k,d,flag)]+=solve(n-i,k,d,True)
    return dp[(n,k,d,flag)]
n,k,d=map(int,raw_input().split())
dp={}
print solve(n,k,d,False)

H = {}
def rec(n,k,d,cd):
    #print n,cd

    if cd == True and n == 0:
        return 1
    if n < 0:
        return 0
    if cd == False and n < d:
        return 0
    if (n,k,d,cd) in H:
        return H[(n,k,d,cd)]

    total = 0
    for i in range(1, min(k+1,n+1) ):
        if i>= d:
            total += rec(n-i,k,d,True)
        else:
            total += rec(n-i,k,d,cd)
    H[(n,k,d,cd)] = total
    return total

def main():
    n,k,d = [int(i) for i in raw_input().split(" ")]
    modp = 1000000007

    print rec(n,k,d,False)

main()

n, k, d = input().split()
n = int(n)
k = int(k)
d = int(d)

module = 10 ** 9 + 7

def f(n, d):
    if n - d < 0:
        return 0
    else:
        ans = n - d + 1
        for i in range(2, d + 1):
            ans += f(n - d, d)
        return ans

ans = 0
for dd in range(d, k + 1):
    ans = (ans + f(n, dd)) % module
print(ans)

inputs = [int(x) for x in input().split()]

desired_weight = inputs[0]
k = inputs[1]
min_weight = inputs[2]

# desired_weight = 38
# k = 16
# min_weight = 15
#
# # desired_weight = 4
# # k = 5
# # min_weight = 2

saved = [{True: None, False: None} for i in range(desired_weight + 1)]
saved[desired_weight] = {True: 0, False: 0}

modulo = 1000000007

for i in reversed(range(0, desired_weight)):
    range_to_work_with = desired_weight - i
    hit_min_value = 0
    fail_to_hit_min_value = 0
    for j in range(1, range_to_work_with + 1):
        if j >= min_weight:
            fail_to_hit_min_value += saved[i + j][False]
        else:
            fail_to_hit_min_value += saved[i + j][True]
    fail_to_hit_min_value += 1 if desired_weight - i <= k and desired_weight - i >= min_weight else 0

    for j in range(1, range_to_work_with + 1):
        hit_min_value += saved[i + j][True]
    hit_min_value += 1 if desired_weight - i <= k else 0

    saved[i][True] = hit_min_value
    saved[i][False] = fail_to_hit_min_value

# count = get_count(0, False)

print(saved[0][False] % modulo)

mem = [[-1 , -1] for x in range(0 , 103)]

n , k , d = map(int , input().split())

def dp(remain,has_d):
    if remain == 0:
        return has_d
    if remain < 0:
        return 0
    if mem[remain][has_d] != -1:
        return mem[remain][has_d]
    mem[remain][has_d] = 0
    for i in range(1 , min(remain,k)+1):
        if i >= d :
            mem[remain][has_d] += dp(remain - i , 1)
        else :
            mem[remain][has_d] += dp(remain - i , has_d)
    return mem[remain][has_d]

print (dp(n,0))

n,k,d=map(int,input().split())
dp=[[0 for i in range(2)] for i in range(101)]
dp[0][0]=1
dp[0][1]=1
for i in range(1,101):
    for j in range(min(i,d)):
        dp[i][0]+=dp[j][0]

    for j in range(min(i,k)):
        dp[i][1]+=dp[j][1]

print((dp[n][1]-dp[n][0]+1)%(10**9+7))

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[1: K+1])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g)
    print(result)

sol()

def admod(a,b):
    a+=b
    if a>1e9+7:
        a-=1e9+7
    return a
n,k,d=list(map(int,input().split()))
Dp=[[1,0]]
for i in range(1,n+1):
    Dp.append([0,0])
    for j in range (1,k+1):
        if i-j<0:   break
        if j<d:
            Dp[i][0]=admod(Dp[i][0],Dp[i-j][0])
            Dp[i][1]=admod(Dp[i][1],Dp[i-j][1])
        else:
            Dp[i][1]=admod(Dp[i][1],Dp[i-j][0])
            Dp[i][1]=admod(Dp[i][1],Dp[i-j][1])
print(Dp[n][1])

inputlist=list(map(int, input().split()))
n=inputlist[0]
k=inputlist[1]
d=inputlist[2]
def dp(sum1,limiter):
    array=[1]*2
    if limiter==1:
        return 1
    elif limiter==2:
        for j in range(sum1-1):
            array.append(array[len(array)-1]+array[len(array)-2])
        return array[-1]
    else:
        if sum1>limiter:
            for j in range(1, limiter-1):
                array.append(2**(j))
            leftpointer=0
            rightpointer=limiter-1
            s=sum(array)
            array.append(s)
            for j in range(sum1-limiter-1):
                s-=array[leftpointer]
                s+=array[rightpointer]
                s.append(array)
                leftpointer+=1
                rightpointer+=1
            return array[-1]
        elif sum1<=limiter:
            return 2**(sum1-1)

print((dp(n,k)-dp(n,d-1)))

x = input()
x = x.split()
n = int(x[0])
k = int(x[1])
d = int(x[2])
c = int(10e9 + 7)
def jie(m, n):
    if (n == m) or (n == 0):
        return 1
    else:
        r = 1
        for i in range(1, m + 1):
            r *= i
        for i in range(1, n + 1):
            r //= int(i)
        for i in range(1, m - n + 1):
            r //= int(i)
        return int(r)
def pai(l):
    s = 1
    n = sum(l[i] for i in range(k))
    for i in range(k):
        s = s * jie(n, l[i])
        n = n - l[i]
        if n == 0:
            break
    return s
def tree(n, k, maxt, mint, m, l):
    if n == 0:
        m = (m + pai(l)) % c
    else:
        for i in range(maxt, mint - 1, -1):
            if i <= n:
                l[i - 1] += 1
                m = tree(n - i, k, i, 1, m, l)
                l[i - 1] -= 1
    return m
l = []
for i in range(k):
    l.append(0)
print(tree(n, k, k, d, 0, l))

import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
# from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
# import numpy as np
starttime = time.time()
# import numpy as np
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

try:
    # sys.setrecursionlimit(int(pow(10,6)))
    sys.stdin = open("input.txt", "r")
    # sys.stdout = open("../output.txt", "w")
except:
    pass

n,k,d=L()
def func(n,A):
    @lru_cache
    def rec(s):
        # print(s)
        if s==0:
            return 1
        if s<0:
            return 0
        ans=0
        for x in A:
            ans+=rec(s-x)
            ans%=mod
        return ans
    return rec(n)

ans=func(n,[i for i in range(1,k+1)])
if d!=1:
    ans-=func(n,[i for i in range(1,d)])
print(ans)

endtime = time.time()
# print(f"Runtime of the program is {endtime - starttime}")

from sys import stdin

# main starts
n, k, d = list(map(int, stdin.readline().split()))
dp = [0] * ( n - d + 1)

mod = 10**9 + 7
for i in range(1, n - d + 1):
	for j in range(1, i):
		dp[i] += dp[j]
		dp[i] %= mod
	if i <= k:
		dp[i] += 1

s1 = sum(dp)
s1 %= mod
dp = [0] * (n + 1 - d)
dp[0] = 1
for i in range(1, n + 1 - d ):
	for j in range(i):
		dp[i] += dp[j]
		dp[i] %= mod
	if i + d <= k:
		dp[i] += 1
s1 += dp[-1]
s1 %= mod
print(s1)

import sys
from random import randint
from time import time

line=map(lambda x:int(x),sys.stdin.readline().strip('\n').split(" "))
n=line[0]
k=line[1]
d=line[2]

numd=[]
num=[1]
for i in xrange(1,k):
    num.append(sum(num[0:i])%1000000007)
    #num.append(num[-1]*2%100000007)
for i in xrange(0,d):
    numd.append(0)
for i in xrange(d,k):
    #print i,numd,num
    numd.append((sum(numd[i-d+1:i])+sum(num[0:i-d+1]))%100000007)

#print numd,num
for i in xrange(k,n+1):
    numd.append(0)
    for j in xrange(1,d):
        numd[i]=(numd[i]+numd[i-j])%100000007
    for j in xrange(d,k+1):
        numd[i]=(numd[i]+num[i-j])%100000007
    num.append(0)
    for j in xrange(1,k+1):
        num[i]=(num[i]+num[i-j])%100000007
#print numd,num
print numd[n]%100000007

"""
    Satwik_Tiwari ;) .
    20 june , 2020  - Tuesday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def bs(a,l,h,x):
    while(l<h):
        # print(l,h)
        mid = (l+h)//2
        if(a[mid] == x):
            return mid
        if(a[mid] < x):
            l = mid+1
        else:
            h = mid
    return l

def sieve(a): #O(n loglogn) nearly linear
    #all odd mark 1
    for i in range(3,((10**6)+1),2):
        a[i] = 1
    #marking multiples of i form i*i 0. they are nt prime
    for i in range(3,((10**6)+1),2):
        for j in range(i*i,((10**6)+1),i):
            a[j] = 0
    a[2] = 1 #special left case
    return (a)

def solve():
    n,k,d = sep()
    coin = []
    for i in range(1,k+1):
        coin.append(i)
    # print(coin)
    dp1 = [0]*(n+1) #without >=d
    dp2 = [0]*(n+1) #with >=d
    dp1[0] = 1
    for i in range(1,n+1):
        for c in coin:
            if(i-c >=0):
                if(c >=d):
                    dp2[i] += dp2[i-c]
                    dp2[i] += dp1[i-c]
                else:
                    dp2[i] +=dp2[i-c]
                    dp1[i] +=dp1[i-c]
    print(dp2[n])

testcase(1)
# testcase(int(inp()))

def func(r, k, a) :
    out = 0
    if r <= k:
        out = 2**(r-1)
    else :

        for i in range(1,k+1) :
            if i <= r :
                if a[r-i] != -1 :
                    out = out + a[r-i]
                else:
                    out = out + func(r-i, k, a)
            else :
                break;
    a[r] = out
    return out

n,k,d = map(int, raw_input().split())
x = [-1]*(n+1)
y = [-1]*(n+1)
print func(n,k,x) - func(n, d-1,y)

n, k, d = map(int,input().split())
f = [0]*(n+k+1)
f_ = [0]*(n+k+1)
f_[0] = 1
for i in range(1,n+1):
    for j in range(1,k+1):
        f[i] += f[i-j]
    for j in range(d,k+1):
        f[i] += f_[i-j]
    for j in range(1,d):
        f_[i] += f_[i-j]
print(f[n])

def k_tree(n, k, d, qtd, suma, flag, memo):
    if suma > n:
        return 0
    if(suma == n):
        if flag == 1:
            return qtd+1
        return qtd
    if memo[suma][flag] != -1:
        return memo[suma][flag]

    for i in range(1, n+1):
        if i >= d:
            flag = 1
        aux = k_tree(n, k, d, qtd, suma + i, flag, memo)
        flag = 0
        if aux > qtd:
            qtd = aux
    memo[suma][flag] = qtd
    return qtd

#main
n, k, d = map(int, input().split())
memo = [[-1 for i in range(2)] for i in range(n)]
#print(memo)
print(k_tree(n, k, d, 0, 0, 0, memo))
#print(qtd)

n,k,d=map(int,input().split())
kp=[-1]*(n+1)
def CP(m):
    global k
    if m==0:return(0)
    if m==1:return(1)
    if kp[m]!=-1:return(kp[m])
    c=0
    for t in range(1,min(m,k)+1):
        c+=1+CP(m-t)
        c=c%(1000000007)

    kp[m]=c
    return(c)
kc=[-1]*(n+1)
def CP2(m):
    global d
    if m==0:return(0)
    if m==1:return(1)
    if kc[m]!=-1:return(kc[m])
    c=0
    for t in range(1,min(m,d-1)+1):
        c+=1+CP(m-t)
        c=c%(1000000007)

    kc[m]=c
    return(c)

print((CP(n)-CP2(n))%1000000007)

#!/usr/bin/python

def memoize(f):
    cache= {}
    def memf(*x):
        if x not in cache:
            cache[x] = f(*x)
        return cache[x]
    return memf

import sys

def Ni(): return tuple(map(int, sys.stdin.readline().split()))
def Ns(): return tuple(map(int, sys.stdin.readline().split()))

n, k, d = Ni()

@memoize
def count(n, haveD):
    #print n, haveD
    if n == 0:
        if haveD:
            return 1
        else:
            return 0

    s = 0
    for i in range(1, min(n, k) + 1):
        s += count(n - i, haveD or i >= d)

    return s

print count(n, False)

rem=10**9+7
def help(n,k):
    arr=[1]*(n+1)
    arr[1]=1
    for i in range(2,n+1):
        s=0
        j=i
        while(j>0):
            if j<=k:
                s=(s+arr[i-j])%rem
            j-=1
        arr[i]=s%rem
    return arr
#n,k,d=map(int,raw_input().split())
def pun(n,p):
    #print p
    arr = [1] * (n + 1)
    arr[1] = 1
    for i in range(2, n + 1):
        s = 0
        j = i
        while (j > 0):
            if j <p:
                s = (s+arr[i - j])%rem
            j -= 1
        arr[i] = s%rem
    return arr
n,k,p=map(int,raw_input().split())
a=help(n,k)
b=pun(n,p)
#print a,b
print (a[n]-b[n])%rem

def solve(s):
    n, k, d = list(map(int, s.split()))
    return int((dp(n, k) - dp(n, d-1)) % (1e9 + 7))

def dp(n, k):
    l = [2**i for i in range(k)]
    while len(l) < n:
        l.append(sum(l[-k:]))
    return l[n-1]

s = input()
print(solve(s))

import sys
import math
input = sys.stdin.readline

def inlt():
    return (list(map(int, input().split())))

def helper(rem, found):
    if rem == 0:
        if found:
            return 1
        return 0

hash_map = {}

def solve(n, found):
    if n == 0:
        if found:
            return 1
        return 0
    if (n, found) in hash_map:
        return hash_map[(n, found)]
    count = 0
    for i in range(1, k+1):
        if not found:
            found = True if i >= d else False
        if i > n:
            break
        count += (solve(n-i, found)) % 1000000007
    hash_map[(n, found)] = count
    return count

if __name__ == '__main__':
    nkd = inlt()
    k, d = nkd[1], nkd[2]
    print(int(solve(nkd[0], False)))

import sys
import math
input = sys.stdin.readline

def inlt():
    return (list(map(int, input().split())))

def helper(rem, found):
    if rem == 0:
        if found:
            return 1
        return 0

hash_map = {}

def solve(n, found):
    if n == 0:
        if found:
            return 1
        return 0
    if (n, found) in hash_map:
        return hash_map[(n, found)]
    count = 0
    for i in range(1, k+1):
        if i > n:
            break
        count += (solve(n-i, found | (True if i >= d else False))) % 1000000007
    hash_map[(n, found)] = count
    return count

if __name__ == '__main__':
    nkd = inlt()
    k, d = nkd[1], nkd[2]

    print(int(solve(nkd[0], False)))

n,k,d=map(int,input().split())
dp =[1]+ [0]*(n)
for j in range(1,n+1):
    for i in range(1,k+1):
        p=j-i
        if p>=0:
            dp[j]+=dp[p]
        else:
            break
dp1=[1]+[0]*n
for j in range(1,n+1):
    for i in range(1,d):
        if i!=d:
            p=j-i
            if p>=0:
                dp1[j]+=dp1[p]
            else:
                break
print(dp[n]-dp1[n])

import bisect
from collections import defaultdict
from collections import deque
import math
import re
import sys
import itertools

def ni():
    return int(raw_input())

def nis():
    return map(int, raw_input().split())

def si():
    return raw_input()

def sis():
    return raw_input().split()

def spaced(a):
    return ' '.join(map(str, a))

n, k, d = nis()

memo = dict()

def solve(total = 0, flag = False):
    if (total, flag) in memo:
        return memo[(total, flag)]

    res = 0

    for i in range(1, k + 1):
        flag |= i >= d
        total += 1
        if total < n:
            res += solve(total, flag)
        else:
            if total == n and flag:
                global ans
                res += 1
            break

    res %= 1000000007

    memo[(total, flag)] = res

    return res

print solve()

n,k,d = map(int,input().split())
# n,k,d = 50,50,2
memo = [-1]*100
def dp(nn,s):
	sum1 = 0
	if nn == 0:
		if(s > (n-(d-1))):
			return 0
		else:
			return 1
	if memo[nn] != -1:
		return memo[nn]
	for i in range(1,(min(k,nn)+1)):
		sum1 += dp(nn-i,s+1) %1000000007
	memo[nn] = sum1
	return sum1
dp(n,0)
result = sum([i for i in memo if i !=-1])
print(result)

n,k,d=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
# for i in range(1,k+1):
# 	dp[i]=1
# print(dp)
for i in range(1,n+1):
	for j in range(1,k+1):
		if i-j>=0:
			dp[i]+=dp[i-j]
		else:
			break
	# print(dp)
ans=[0]*(n+1)
# print("************")
dp[0]=1
for i in range(1,n+1):
	for j in range(1,k+1):
		if i-j>=0:
			if j>=d:
				ans[i]+=dp[i-j]
			elif i-j>=d:
				ans[i]+=ans[i-j]
		else:
			break
	# print(ans)

print(ans[n])

n,k,d=map(int,input().split())
l=[0]
for i in range(1,n+1):
    if i<d:
        l.append(2**(i-1))
    else:
        a=0
        for m in range(1,d):
            a+=l[i-m]
        l.append(a)
print((2**(n-1)-l[n])%(10**9+7))

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[x-K: x])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g-1)
    print(result)

sol()

mod = 1e9+7

def Sulution():
	n,k,d = [int(x) for x in input().split()]
	dp = [[0 for i in range(2)]for j in range(101)]
	dp[0][0] = 1
	dp[0][1] = 0
	for i in range(1,n+1):
		for j in range(1,k+1):
			if i < j:
				break
			if j < d:
				dp[i][0] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			else:
				dp[i][1] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			if dp[i][0] >= mod:
				dp[i][0] -= mod
			if dp[i][1] >= mod:
				dp[i][1] -= mod

	return dp[n][1]

print(Sulution())

n, k, d = [int(i) for i in raw_input().split()]
dp = [[0, 0] for i in range(n + 1)]
dp[0][0] = 1
for i in range(1, n + 1):
	total = 0
	for j in range(1, min(d, i + 1)):
		total += dp[i - j][0]
	dp[i][0] = total
for i in range(1, n + 1):
	total = 0
	for j in range(1, min(d, i + 1)):
		total += dp[i - j][1]
	for j in range(d, min(i, k) + 1):
		total += (dp[i - j][0] + dp[i - j][1])
	dp[i][1] = total
print dp[n][1]

def func(r, k, a) :
    out = 0
    if r <= k:
        out = 2**(r-1)
    else :

        for i in range(1,k+1) :
            if i <= r :
                if a[r-i] != -1 :
                    out = out + a[r-i]
                else:
                    out = out + func(r-i, k, a)
            else :
                break;
    a[r] = out
    return out

n,k,d = map(int, raw_input().split())
x = [-1]*(n+1)
y = [-1]*(n+1)
print func(n,k,x) - func(n, d-1,y)

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[1: K+1])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g)
    print(result)

sol()

a = input()
list_a = list(map(int,a.split()))
n = list_a[0]
k = list_a[1]
d = list_a[2]############################## modulo 10^9 +7
solutions = []
for numbers in range(n+1):
    solutions.append(-1)
def dp(n,k,solutions):
    if n ==1:
        solutions[1] = 1
        return 1
    if solutions[n] != -1:
        return solutions[n]
    else:
        answer = 0
        x = 1
        while n - x > 0 and x <=k:
            answer += dp(n-x,k,solutions)
            x +=1
        if n <= k:
            answer += 1
        solutions[n] = answer
        return answer
solutions_copy = []
for numbers in range(n+1):
    solutions_copy.append(-1)
def dp_2(n,k,solutions_copy,d):
    if n ==1:
        solutions_copy[1] = 1
        return 1
    if solutions_copy[n] != -1:
        return solutions_copy[n]
    else:
        answer = 0
        x = 1
        while n - x > 0 and x <=k:
            if x < d :
                answer += dp_2(n-x,k,solutions_copy,d)
                x +=1
            else:
                x+=1
                continue
        if n <= k and n < d:
            answer += 1
        solutions_copy[n] = answer
        return answer
if n == d ==1:
    print(0)
else:
    print((dp(n,k,solutions)-dp_2(n,k,solutions_copy,d))%(10**9 + 7))

import sys
from math import log2,floor,ceil,sqrt,gcd
# import bisect
# from collections import deque
# sys.setrecursionlimit(7*10**4)

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD =  1000000007

n,k,d = Ri()
no = [0]*(n+1)
no[0] = 1
for i in range(1,n+1):
    for j in range(1,k+1):
        if j > i:
            break
        no[i]+=no[i-j]
        no[i]%=MOD
# print(no)
nod = [0]*(n+1)
nod[0] = 1
for i in range(1,n+1):
    for j in range(1,k+1):
        if j > i : break
        if j >= d : break
        nod[i]+=nod[i-j]
        nod[i]%=MOD
# print(nod)
print(no[n]-nod[n])

n,k,d=map(int,input().split())
dp=[[0 for i in range(2)] for i in range(101)]
dp[0][0]=1
dp[0][1]=1
for i in range(1,101):
    for j in range(min(i,d)):
        dp[i][0]+=dp[j][0]

    for j in range(min(i,k)):
        dp[i][1]+=dp[j][1]

print((dp[n][1]-dp[n][0]+1)%(10**9+7))

n, k, d = map(int, raw_input().split(' '))

dp = [[ 0 for x in range(2) ] for y in range(100) ]

def add(a,b):
    a = a+b
    if a>10**9+7:
        return a - 10**9+7
    else:
        return a

dp[0][0] = 1
dp[0][1] = 0

for i in range(1,n+1):
    for j in range(1,k+1):
        if i-j < 0:
            break
        if(j<d):
            dp[i][0] = add(dp[i][0], dp[i-j][0])
            dp[i][1] = add(dp[i][1], dp[i-j][1])
        else:
            dp[i][1] = add(dp[i][1], dp[i-j][0])
            dp[i][1] = add(dp[i][1], dp[i-j][1])

print dp[n][1]

import sys
input=sys.stdin.readline

n,k,d=map(int,input().split())
dp=[[0,0] for i in range(n+1)]
dp[1][0]=1
dp[0][0]=1
for i in range(2,n+1):
    for j in range(1,min(i+1,k+1)):
        if j<d:
            dp[i][0]+=dp[i-j][0]
        if j>=d:
                dp[i][1]+=dp[i-j][0]+dp[i-j][1]
        else:
            dp[i][1]+=dp[i-j][1]
    #print(dp)
print(dp[n][1])

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[1: K+1])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g-1)
    print(result)

sol()

n, k, d = map(int,input().split())
f = [0]*(n+k+1)
f_ = [0]*(n+k+1)
f_[0] = 1
for i in range(1,n+1):
    for j in range(1,k+1):
        f[i] += f[i-j]
    for j in range(d,k+1):
        f[i] += f_[i-j]
    for j in range(1,d):
        f_[i] += f_[i-j]
print(f[n])

def func(n,k):
    p=1000000007
    arr=[0 for i in range(n+1)]
    arr[0]=1
    if(n<=0):return 0
    for j in range(1,n+1):
        for i in range(1,min(k+1,j+1)):
            arr[j]+=arr[j-i]
            arr[j]%=p
    return arr[n]
n,k,d=map(int,input().split())
print(func(n,k)-func(n,d-1))

N, K, D = [int(i) for i in input().split()]

M = 100
T = [[0]*(M+1),
     [0]*(M+1)]
"""Dynamic programming table

T[d, n] is the number of paths where you can accumulate a total of n with (or
without) seeing a branch of length D.

"""

# Initialization.
for k in range(1, K+1):
    T[k>=D][k] = 1

# Dynamic programming.
for n in range(1, M+1):
    for k in range(1, K+1):
        if n+k > M:
            continue
        T[1][n+k] += T[1][n]
        T[k>=D][n+k] += T[0][n]

print(T[1][N])

import random
import sys
Q = 10 ** 9 + 7
n, k, d = map(int, input().split())
dp = [0] * 105
dp1 = [0] * 105
dp[0] = 1
dp1[0] = 1
for i in range(1, n + 1):
    for j in range(max(0, i - k), i):
        dp[i] = (dp[i] + dp[j]) % Q
    for j in range(max(0, i - d + 1), i):
        dp1[i] = (dp1[i] + dp1[j]) % Q
print(dp[n] - dp1[n])

x = input()
x = x.split()
n = int(x[0])
k = int(x[1])
d = int(x[2])
c = 1000000007
counter = 0
result = {}
def jie(m, n):
    global counter
    counter = counter + 1
    if (n == m) or (n == 0):
        return 1
    else:
        r = 1
        a = min(n, m - n)
        b = max(n, m - n)
        for i in range(b + 1, m + 1):
            r *= i
        for i in range(1, a + 1):
            r //= int(i)
        return int(r)
def pai(l):
    s = 1
    n = sum(l[i] for i in range(k))
    for i in range(k):
        if n in result:
            if l[i] in result[n]:
                t = result[n][l[i]]
            else:
                t = jie(n, l[i])
                result[n][l[i]] = t
        else:
            t = jie(n, l[i])
            result[n] = {l[i]: t}
        s = s * t
        n = n - l[i]
        if n == 0:
            break
    return s
def tree(n, k, maxt, mint, m, l):
    if n == 0:
        m = (m + pai(l)) % c
    else:
        for i in range(maxt, mint - 1, -1):
            if i <= n:
                l[i - 1] += 1
                m = tree(n - i, k, i, 1, m, l)
                l[i - 1] -= 1
    return m
l = []
for i in range(k):
    l.append(0)
print(tree(n, k, k, d, 0, l), counter)

import collections

def count(n, k):

    m = collections.defaultdict(lambda: 0)
    m[0] = 1
    for i in range(1, n + 1):

        for j in range(1, k + 1):

            if i - j in m:

                m[i] += m[i - j]

    return m[n]

n, k, d = tuple(map(int, str.split(input())))
print(count(n, k) - count(n, d - 1))

n,k,d=map(int,input().split())
dp =[1]+ [0]*(n)
for j in range(1,n+1):
    for i in range(1,k+1):
        p=j-i
        if p>=0:
            dp[j]+=dp[p]
        else:
            break
dp1=[1]+[0]*n
for j in range(1,n+1):
    for i in range(1,d):
        if i!=d:
            p=j-i
            if p>=0:
                dp1[j]+=dp1[p]
            else:
                break
print((dp[n]-dp1[n])%(10e9+7))

mod = 1e9+7

def Sulution():
	n,k,d = [int(x) for x in input().split()]
	dp = [[0 for i in range(2)]for j in range(101)]
	dp[0][0] = 1
	dp[0][1] = 0
	for i in range(1,n+1):
		for j in range(1,k+1):
			if i < j:
				break
			if j < d:
				dp[i][0] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			else:
				dp[i][1] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			if dp[i][0] >= mod:
				dp[i][0] -= mod
			if dp[i][1] >= mod:
				dp[i][1] -= mod

	return dp[n][1]

print(Sulution())

n, k, d = map(int, input().split())
s = [(1, i, True) if i >= d else (1, i, False) for i in range(1, k+1) if i <= n]
c = 0

while s:
    cur = s.pop()
    if cur[1] == n and cur[2]:
        c += 1
    for i in range(1, k+1):
        if cur[0] < k and cur[1] + i <= n:
            s.append((cur[0]+1, cur[1]+i, cur[2] or i >= d))

print(c)

x = input()
x = x.split()
n = int(x[0])
k = int(x[1])
d = int(x[2])
c = int(10e9 + 7)
def jie(m, n):
    if (n == m) or (n == 0):
        return 1
    else:
        r = 1
        for i in range(1, m + 1):
            r *= i
        for i in range(1, n + 1):
            r /= i
        for i in range(1, m - n + 1):
            r /= i
        return int(r)
def pai(l):
    s = 1
    n = sum(l[i] for i in range(k))
    for i in range(k):
        s = s * jie(n, l[i])
        n = n - l[i]
        if n == 0:
            break
    #print(l,s)
    return s
def tree(n, k, maxt, mint, m, l):
    if n == 0:
        m = (m + pai(l)) % c
    else:
        for i in range(maxt, mint - 1, -1):
            if i <= n:
                l[i - 1] += 1
                m = tree(n - i, k, i, 1, m, l)
                l[i - 1] -= 1
    return m
l = []
for i in range(k):
    l.append(0)
print(tree(n, k, k, d, 0, l))

__author__ = 'd555_'
db = False
MOD = 1000000007

if db:
    import sys
    sys.stdin = open("input.txt", "r")

n, k, d = map(int, raw_input().split())

dp = dict()

def f(n, x):
    if db:
        print "f",(n,x)," ->"

    if (n, x) in dp:
        if db: print dp[(n,x)], " con ", (n,x)
        return dp[(n, x)]
    if n == 0:
        if db: print "n=0", (n,x) ,"=>", (d <= x <= k)
        dp[(0, x)] = (d <= x <= k)
        return d <= x <= k
    if n < 0:
        if db: print "n<0", (n,x)
        dp[(n, x)] = 0
        return 0
    c = 0
    for i in range(1, k+1):
        c += f(n - i, max(x, i))%MOD if n - i >= 0 else 0
    dp[(n, x)] = c
    return c

if db: print dp
print f(n, 0)

n,v,d=list(map(int,input().split()))
dp=[[0]*2 for i in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for k in range(1,min(i,v)+1):
        dp[i][0]+=dp[i-k][0]
        if k>=d:
            dp[i][1]+=dp[i-k][0]
        else:
            dp[i][1]+=dp[i-k][1]
print(dp[n][1])

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[1: K+1])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g)
    print(result)

sol()

MOD = 1000000007
dp = [-1 for i in range(101)]

def k_tree(n, k, d, least_d_selected):
    if n < 0:
        return 0
    if n == 0 and least_d_selected:
        return 1
    if n == 0 and not least_d_selected:
        return 0
    temp = 0
    if dp[n] != -1:
        return dp[n]
    for i in range(k):
        if not least_d_selected and (i+1) >= d:
            temp += k_tree(n-(i+1), k, d, True)
            temp %= MOD
        temp += k_tree(n-(i+1), k, d, least_d_selected)
        temp %= MOD
    dp[n] = temp
    return dp[n]

def k_tree_runner():
    line = input()
    sn, sk, sd = line.split(' ')
    n = int(sn)
    k = int(sk)
    d = int(sd)
    print(k_tree(n, k, d, False) + 2)

k_tree_runner()

#!/usr/bin/pypy3

from sys import stdin,stderr

def readInts(): return map(int,stdin.readline().strip().split())
def print_err(*args,**kwargs): print(*args,file=stderr,**kwargs)

def naive_kt(k,d,n):
    if n<0: return 0
    if n<d: return 0
    if n==0: return 1
    s = 0
    for i in range(1,k+1):
        d2 = 0
        if i>=d: d2 = 0
        else: d2 = d
        s += naive_kt(k,d2,n-i)
    return s

def dp_kt(k,d,n):
    a_d_used = [1]
    a_d_unused = [0]
    for ni in range(1,n+1):
        s = 0
        for si in range(max(0,ni-k),ni):
            s += a_d_used[si]
        a_d_used.append(s)
    for ni in range(1,n+1):
        s = 0
        for si in range(1,k+1):
            if ni-si<0: continue
            v = a_d_unused[ni-si]
            if si>=d: v = a_d_used[ni-si]
            s += v
        a_d_unused.append(s)
    return a_d_used,a_d_unused

def solve(vs):
    return None

def run():
    n,k,d = readInts()
    _, dp = dp_kt(k,d,n)
    print(dp[-1])

run()

n, k, d = map(int, raw_input().split(' '))

dp = [[ 0 for x in range(2) ] for y in range(100) ]

def add(a,b):
    a = a+b
    if a>=10**9+7:
        return a - 10**9+7
    else:
        return a

dp[0][0] = 1
dp[0][1] = 0

for i in range(1,n+1):
    for j in range(1,k+1):
        if i-j < 0:
            break
        if(j<d):
            dp[i][0] = add(dp[i][0], dp[i-j][0])
            dp[i][1] = add(dp[i][1], dp[i-j][1])
        else:
            dp[i][1] = add(dp[i][1], dp[i-j][0])
            dp[i][1] = add(dp[i][1], dp[i-j][1])

print dp[n][1]

import functools
import sys

p = 10**9 + 7

line = input()
tokens = line.split()
n, k, d = int(tokens[0]), int(tokens[1]), int(tokens[2])

@functools.lru_cache(None)
def f(s):
    if s == 0:
        return 1

    total = 0
    for w in range(1, k + 1):
        if w > s:
            break
        total += f(s - w)
    return total % p

@functools.lru_cache(None)
def g(s):
    if s == 0:
        return 1
    total = 0
    for w in range(1, min(d, k + 1)):
        if w > s:
            break
        total += g(s - w)
    return total % p

print(f(n) - g(n))

(desiredWeight, maxEdgeWeight, minEdgeWeight) = [
    int(x) for x in input().split()]
mic = [[-1]*5 for _ in range(desiredWeight+1)]

modValue = 1000000007

def pathWithWeight(weight: int, containMin: int):
    if(weight < 0):
        return 0
    if(weight == 0):
        return containMin ^ 1
    if(weight <= 1):
        if(containMin == 1 and minEdgeWeight > weight):
            return 0
        else:
            return 1
    if(mic[weight][containMin] != -1):
        return mic[weight][containMin]
    result = 0
    if (minEdgeWeight <= weight):
        if(containMin == 1):
            result = 1
        else:
            result = 0
    for i in range(1, min(maxEdgeWeight, weight)):
        if(i < minEdgeWeight):
            result += pathWithWeight(weight-i, containMin)
        else:
            result += pathWithWeight(weight-i, 0)
            if(containMin == 1):
                result += pathWithWeight(weight-i, 1)
    mic[weight][containMin] = result
    # print("weight:", weight, "containmin", containMin, result)
    return result

print(pathWithWeight(desiredWeight, 1))

def func(r, k, a) :
    out = 0
    if r <= k:
        out = 2**(r-1)
    else :

        for i in range(1,k+1) :
            if i <= r :
                if a[r-i] != -1 :
                    out = out + a[r-i]
                else:
                    out = out + func(r-i, k, a)
            else :
                break;
    a[r] = out
    return out

n,k,d = map(int, raw_input().split())
x = [-1]*(n+1)
y = [-1]*(n+1)
print func(n,k,x) - func(n, d-1,y)

n,k,d=map(int,input().split())
l=[0]
for i in range(1,n+1):
    if i<d:
        l.append(2**(i-1))
    else:
        a=0
        for m in range(1,d):
            a+=l[i-m]
        l.append(a)
print((2**(n-1)-l[n])%(10**9+7))

def dp(n,k,d,f,m):

    if (n == 0):
        if (f == True):
            return 1
        return 0
    if (n < 0):
        return 0
    if (m[n][f] != -1):
        return m[n][f]

    res = 0

    for i in range(1,k+1):
        if (i >= d):
            res += dp(n-i,k,d,f | True,m)
        else:
            res += dp(n-i,k,d,f | False,m)

    m[n][f] = res

    return m[n][f]

if __name__ == '__main__':
    n, k, d = [int(x) for x in input().split()]
    m = [[-1,-1] for _ in range(n+1)]
    print(dp(n,k,d,False,m))

n,k,d=map(int,input().split())
dp1=[0]*10000
dp2=[0]*10000
dp1[0]=1
dp2[0]=1
MOD=1e9+7
for i in range(n):
	for j in range(1,k+1):
		dp1[i+j]+=dp1[i]
	for j in range(1,d):
		dp2[i+j]+=dp2[i]
if d>n:
	print(0)
else:
	print((int(dp1[n]-dp2[n])%MOD))

n,k,d = map(int,input().split())
# n,k,d = 50,50,2
memo = [-1]*100
def dp(nn,s):
	sum1 = 0
	if nn == 0:
		if(s > (n-(d-1))):
			return 0
		else:
			return 1
	if memo[nn] != -1:
		return memo[nn]
	for i in range(1,(min(k,nn)+1)):
		sum1 += dp(nn-i,s+1) %1000000007
	memo[nn] = sum1
	return sum1
dp(n,0)
result = sum([i for i in memo if i !=-1])
print(result)

n, k, d = [int(k) for k in input().split()]
ways = [0]*(n+1)
ways[0] = 1
ways[1] = 1

for i in range(2, n+1):
    for j in range(max(0, i-k), i):
        ways[i]+=ways[j]
print(ways)

delete = 0
for i in range(1,d):
    delete +=ways[i]
print(ways[n]-delete)

def w(N, K):
    a = [0]*(N+1)
    a[0] = 1
    d = 1
    i = 1
    while i <= min(N, K):
        a[i] = d
        d += a[i]
        i += 1
    if N > K:
        x = K+1
        while x <= N:
            a[x] = sum(a[x-K: x])
            x += 1

    return a[-1]

def sol():
    n, k, g = map(int, input().split(" "))
    result = w(n, k)-w(n, g-1)
    print(result)

sol()

import sys
sys.setrecursionlimit(100000)
n, k, d = [int(x) for x in sys.stdin.readline().strip().split()]
memo = {}
m = 10**9 +7
def dp(n,k,d):
	if n in memo:
		return memo[n]
	if n==0:
		return 1
	if n<0:
		return 0
	s = 0
	for i in range(1,k+1):
			if i>=d :
				s+=dp(n-i,k,0)
			elif n-i>=d:
				s+=dp(n-i,k,d)
	memo[n]=s
	return s
print(dp(n,k,d)%m)

def func(n,k):
    p=1000000007
    arr=[0 for i in range(n+1)]
    arr[0]=1
    if(n<=0):return 0
    for j in range(1,n+1):
        for i in range(1,min(k+1,j+1)):
            arr[j]+=arr[j-i]
            arr[j]%=p
    return arr[n]
n,k,d=map(int,input().split())
print(func(n,k)-func(n,d-1))

mod = 1e9+7
def add(a,b):
	a += b
	if a >= mod:
		return a-mod
	return a

def Sulution():
	n,k,d = [int(x) for x in input().split()]
	dp = [[0 for i in range(2)] for j in range(100)]
	print(dp)
	dp[0][0] = 1
	dp[0][1] = 0
	for i in range(1,n):
		for j in range(1,k):
			if i < j:
				break
			if j < d:
				dp[i][0] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			else:
				dp[i][1] += dp[i-j][0]
				dp[i][1] += dp[i-j][1]
			if dp[i][0] >= mod:
				dp[i][0] -= mod
			if dp[i][1] >= mod:
				dp[i][1] -= mod

	return dp[n][1]

Sulution()

#!/usr/bin/env python
from __future__ import division, print_function

import itertools, os, sys, threading
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect

# sys.setrecursionlimit(10**7)

input = lambda: sys.stdin.readline().rstrip("\r\n")
read = lambda: list(map(int, input().strip().split(" ")))

def main():
    n, k, d = read()
    dic = {}
    def func(required, f):
        key = str(required)+"-"+str(f)
        if key in dic:
            return(dic[key])
        if required == 0:
            if f:return(1)
            else:return(0)

        if required< 0:
            return(0)
        ans = 0
        for i in range(1, k+1):
            ans +=  func(required-i, [f, 1][i >= d])
        dic[key] = ans
        return(ans)
    print(func(n, 0))
    # print(dic)

if __name__ == "__main__":
    main()
    # sys.setrecursionlimit(100000000)
    # threading.stack_size(20480000)
    # thread = threading.Thread(target=main)
    # thread.start()

n, k, d = map(int, input().split())

combs = []
for i in range(n):
    if i == 0:
        combs.append(1)
    else:
        fix = combs[i - 1] * (n - i) // i
        combs.append(fix)

ans = 0
MOD = int(1e9) + 7
for comb in combs:
    ans = (ans + comb) % MOD

if n > k:
    for i in range(n - k):
        ans = (ans - combs[i]) % MOD

if d > 1:
    for i in range(d - 1):
        ans = (ans - combs[i]) % MOD

print(ans)

n,k,d=map(int,input().split())

s1=[0]*110
s2=[0]*110
s1[0],s2[0]=1,1

for i in range(1,n+1):
    for j in range(1,k+1):
        if(j>i):
            break
        else:
            s1[i]+=s1[i-j]
    # print(s1[i])

    for j in range(1,d):
        if(j>i):
            break
        else:
            s2[i]+=s2[i-j]
print(s1[n]-s2[n])

memo = {}

tg,k,d = map(int,input().split())

def rec(n):
    if n in memo:
        return memo[n]

    ans = [0,0]

    for b in range(1, min(k,n)+1):

        if b == n:
            ans[b>=d]+=1
            continue

        r = rec(n-b)
        ans[1]+=r[1]
        ans[b>=d]+=r[0]

    memo[n] = ans
    return ans

print(rec(tg)[1])

rem=10**9+7
def help(n,k):
    arr=[1]*(n+1)
    arr[1]=1
    for i in range(2,n+1):
        s=0
        j=i
        while(j>0):
            if j<=k:
                s=(s+arr[i-j])%rem
            j-=1
        arr[i]=s%rem
    return arr
#n,k,d=map(int,raw_input().split())
def pun(n,p):
    #print p
    arr = [1] * (n + 1)
    arr[1] = 1
    for i in range(2, n + 1):
        s = 0
        j = i
        while (j > 0):
            if j <p:
                s = (s+arr[i - j])%rem
            j -= 1
        arr[i] = s%rem
    return arr
n,k,p=map(int,raw_input().split())
a=help(n,k)
b=pun(n,p)
#print a,b
print (a[n]-b[n])%rem

'''
Created on 19/09/2017

@author:
'''
import logging
import sys
nivel_log = logging.ERROR
#nivel_log = logging.DEBUG
logger_cagada = None

def kk_tree_core(n, k, d):
    dp = [0] * (n + 1)
    dp_grande = [0] * (n + 1)
    dp[0] = 1
    dp_grande[0] = 1
    num_formas = 0
    for tam_casilla in range(1, n - d + 1):
        logger_cagada.debug("en tam casilla {}".format(tam_casilla))
        for num_act in range(1, d):
            if(num_act > tam_casilla):
                break
            resto = tam_casilla - num_act
            logger_cagada.debug("num act {} resto {}".format(num_act, resto))
            dp[tam_casilla] += dp[resto]
    logger_cagada.debug("la dp es {}".format(dp))
    dp[0] = 0
    for tam_casilla in range(d, n + 1):
        logger_cagada.debug("el tam casilla g {}".format(tam_casilla))
        for num_act in range(1, k + 1):
            if(num_act > tam_casilla):
                break
            resto = tam_casilla - num_act
            if(resto < d and num_act < d):
                continue
            logger_cagada.debug("num act g {} resto {}".format(num_act, resto))
            num_formas_chicas = dp[resto] if num_act >= d else 0
            num_formas_grandes = dp_grande[resto]
            logger_cagada.debug("num formas chicas {} grandes {}".format(num_formas_chicas, num_formas_grandes))
            dp_grande[tam_casilla] += num_formas_chicas + num_formas_grandes
    logger_cagada.debug("la dp grande  es {}".format(dp_grande))

    num_formas = dp_grande[n]

    return num_formas

def kk_tree_main():
    lineas = list(sys.stdin)
    n, k, d = [int(x) for x in lineas[0].strip().split(" ")]
    resu = kk_tree_core(n, k, d)
    print("{}".format(resu))

if __name__ == '__main__':
        FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
        logging.basicConfig(level=nivel_log, format=FORMAT)
        logger_cagada = logging.getLogger("asa")
        logger_cagada.setLevel(nivel_log)
        kk_tree_main()

n, k, d = map(int, input().split())
ans = {}

def dp_solve(n, k):
    ans[0] = 1
    ans[1] = 1
    for i in range(2, n+1):
        cur_t = 0
        for j in range(1, k+1):
            if i-j >= 0:
                cur_t += ans[i-j]
        ans[i] = cur_t
    return ans[n]

a = dp_solve(n, k)
b = dp_solve(n, d-1)
print(a-b)

MOD = 1000000007
dp = [-1 for i in range(101)]

def k_tree(n, k, d, least_d_selected):
    if n < 0:
        return 0
    if n == 0 and least_d_selected:
        return 1
    if n == 0 and not least_d_selected:
        return 0
    temp = 0
    if dp[n] != -1:
        return dp[n]
    for i in range(k):
        if not least_d_selected and (i+1) >= d:
            temp += k_tree(n-(i+1), k, d, True)
            temp %= MOD
        temp += k_tree(n-(i+1), k, d, least_d_selected)
        temp %= MOD
    dp[n] = temp
    return dp[n]

def k_tree_runner():
    line = input()
    sn, sk, sd = line.split(' ')
    n = int(sn)
    k = int(sk)
    d = int(sd)
    print(k_tree(n, k, d, False) + 1)

k_tree_runner()