MOD = 1_000_000_007

def comb(n, k)
  return comb(n, n - k) if k > n - k
  return 1 if k == 0
  c = 1
  (1..k).each do |i|
    c *= (n - i + 1)
    c /= i
  end
  c % MOD
end

loop do
  n, d, x = gets.split.map(&:to_i)
  break if n == 0
  if d * (x - 1) < n
    puts 0
    next
  end
  in_ex = 0
  (0..n/x).each do |k|
    in_ex += (-1) ** k * comb(d, k) * comb(n - x * k + d - 1, d - 1)
  end
  p in_ex % MOD
end
