#include <bits/stdc++.h>
using namespace std;
long long int power(int n) {
  long long int ans = 1;
  for (int i = 0; i < n - 1; i++) {
    ans = (ans * 2) % 1000000007;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, d;
  cin >> n >> k >> d;
  long long int S = 1, P = 0, ans;
  if (n < d) {
    cout << "0\n";
    return 0;
  } else if (n <= k) {
    S = power(n);
    long long int tmp1[n + 1];
    tmp1[0] = 1;
    tmp1[1] = 1;
    long long int x = 1;
    if (d < 2) x = 0;
    for (int i = 2; i < d; i++) {
      tmp1[i] = (tmp1[i - 1] * 2) % 1000000007;
      x = (x + tmp1[i]) % 1000000007;
    }
    for (int i = d; i <= n; i++) {
      tmp1[i] = x;
      x = (2 * x - tmp1[i - d + 1]) % 1000000007;
      if (x < 0) x = 1000000007 + x;
    }
    P = tmp1[n];
    ans = (S - P) % 1000000007;
  } else {
    long long int tmp[n + 1];
    tmp[0] = 1;
    tmp[1] = 1;
    long long int x1 = 1;
    if (k == 1) x1 = 0;
    for (int i = 2; i <= k; i++) {
      tmp[i] = (tmp[i - 1] * 2) % 1000000007;
      x1 = (x1 + tmp[i]) % 1000000007;
    }
    for (int i = k + 1; i <= n; i++) {
      tmp[i] = x1;
      x1 = (2 * x1 - tmp[i - k]) % 1000000007;
      if (x1 < 0) x1 = 1000000007 + x1;
    }
    S = tmp[n];
    long long int tmp1[n + 1];
    tmp1[0] = 1;
    tmp1[1] = 1;
    long long int x = 1;
    if (d < 2) x = 0;
    for (int i = 2; i < d; i++) {
      tmp1[i] = (tmp1[i - 1] * 2) % 1000000007;
      x = (x + tmp1[i]) % 1000000007;
    }
    for (int i = d; i <= n; i++) {
      tmp1[i] = x;
      x = (2 * x - tmp1[i - d + 1]) % 1000000007;
      if (x < 0) x = 1000000007 + x;
    }
    P = tmp1[n];
    ans = (S - P) % 1000000007;
  }
  if (ans < 0) {
    ans = ans + 1000000007;
  }
  cout << ans << "\n";
  return 0;
}
