using System; using static System.Console; using System.Linq; using System.Collections.Generic; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics.X86; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, d, k) = (c[0], c[1], c[2]); var dp = new long[k + 2]; var mod = 1_000_000_007; dp[0] = 1; for (var t = 0; t < n; ++t) { var ndp = new long[k + 2]; for (var i = 0; i < k; ++i) { ndp[i + 1] = (ndp[i + 1] + dp[i]) % mod; var end = Math.Min(k + 1, i + d + 1); ndp[end] = (ndp[end] - dp[i] + mod) % mod; } for (var j = 1; j < ndp.Length; ++j) ndp[j] = (ndp[j] + ndp[j - 1]) % mod; dp = ndp; } WriteLine(dp[k]); } }