// input
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

mod mint {
    use std::fmt;
    use std::ops::{
        Add, AddAssign, BitXor, BitXorAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign,
    };

    pub const MOD: i32 = 1_000_000_007;
    pub const ZERO: Mint = Mint { val: 0 };
    pub const ONE: Mint = Mint { val: 1 };
    pub const TWO: Mint = Mint { val: 2 };

    #[derive(Clone, Copy, Debug)]
    pub struct Mint {
        val: i32,
    }

    impl Add for Mint {
        type Output = Self;
        fn add(self, other: Self) -> Self {
            let mut v = self;
            v += other;
            v
        }
    }

    impl AddAssign for Mint {
        fn add_assign(&mut self, other: Self) {
            self.val += other.val;
            if self.val >= MOD {
                self.val -= MOD;
            }
        }
    }

    impl Sub for Mint {
        type Output = Self;
        fn sub(self, other: Self) -> Self {
            let mut v = self;
            v -= other;
            v
        }
    }

    impl SubAssign for Mint {
        fn sub_assign(&mut self, other: Self) {
            self.val -= other.val;
            if self.val < 0 {
                self.val += MOD;
            }
        }
    }

    impl Mul for Mint {
        type Output = Self;
        fn mul(self, other: Self) -> Self {
            let mut v = self;
            v *= other;
            v
        }
    }

    impl MulAssign for Mint {
        fn mul_assign(&mut self, other: Self) {
            self.val = ((self.val as i64) * (other.val as i64) % (MOD as i64)) as i32;
        }
    }

    impl Div for Mint {
        type Output = Self;
        fn div(self, other: Self) -> Self {
            let mut v = self;
            v /= other;
            v
        }
    }

    impl DivAssign for Mint {
        fn div_assign(&mut self, other: Self) {
            *self *= other ^ Mint::from(MOD - 2);
        }
    }

    impl BitXor for Mint {
        type Output = Self;
        fn bitxor(mut self, other: Self) -> Self {
            self ^= other;
            self
        }
    }

    impl BitXorAssign for Mint {
        fn bitxor_assign(&mut self, mut other: Self) {
            let mut x = *self;
            *self = 1.into();
            while other.val != 0 {
                if (other.val & 1) == 1 {
                    *self *= x;
                }
                x *= x;
                other.val >>= 1;
            }
        }
    }

    // i32
    impl Add<i32> for Mint {
        type Output = Self;
        fn add(self, other: i32) -> Self {
            self + Mint::from(other)
        }
    }

    impl AddAssign<i32> for Mint {
        fn add_assign(&mut self, other: i32) {
            *self += Mint::from(other);
        }
    }

    impl Sub<i32> for Mint {
        type Output = Self;
        fn sub(self, other: i32) -> Self {
            self - Mint::from(other)
        }
    }

    impl SubAssign<i32> for Mint {
        fn sub_assign(&mut self, other: i32) {
            *self -= Mint::from(other);
        }
    }

    impl Mul<i32> for Mint {
        type Output = Self;
        fn mul(self, other: i32) -> Self {
            self * Mint::from(other)
        }
    }

    impl MulAssign<i32> for Mint {
        fn mul_assign(&mut self, other: i32) {
            *self *= Mint::from(other);
        }
    }

    impl Div<i32> for Mint {
        type Output = Self;
        fn div(self, other: i32) -> Self {
            self / Mint::from(other)
        }
    }

    impl DivAssign<i32> for Mint {
        fn div_assign(&mut self, other: i32) {
            *self /= Mint::from(other);
        }
    }

    impl BitXor<i32> for Mint {
        type Output = Self;
        fn bitxor(self, other: i32) -> Self {
            self ^ Mint::from(other)
        }
    }

    impl BitXorAssign<i32> for Mint {
        fn bitxor_assign(&mut self, other: i32) {
            *self ^= Mint::from(other);
        }
    }

    impl From<i32> for Mint {
        fn from(mut item: i32) -> Self {
            while item >= MOD {
                item -= MOD
            }
            while item < 0 {
                item += MOD
            }
            Mint { val: item }
        }
    }

    // usize
    impl Add<usize> for Mint {
        type Output = Self;
        fn add(self, other: usize) -> Self {
            self + Mint::from(other)
        }
    }

    impl AddAssign<usize> for Mint {
        fn add_assign(&mut self, other: usize) {
            *self += Mint::from(other);
        }
    }

    impl Sub<usize> for Mint {
        type Output = Self;
        fn sub(self, other: usize) -> Self {
            self - Mint::from(other)
        }
    }

    impl SubAssign<usize> for Mint {
        fn sub_assign(&mut self, other: usize) {
            *self -= Mint::from(other);
        }
    }

    impl Mul<usize> for Mint {
        type Output = Self;
        fn mul(self, other: usize) -> Self {
            self * Mint::from(other)
        }
    }

    impl MulAssign<usize> for Mint {
        fn mul_assign(&mut self, other: usize) {
            *self *= Mint::from(other);
        }
    }

    impl Div<usize> for Mint {
        type Output = Self;
        fn div(self, other: usize) -> Self {
            self / Mint::from(other)
        }
    }

    impl DivAssign<usize> for Mint {
        fn div_assign(&mut self, other: usize) {
            *self /= Mint::from(other);
        }
    }

    impl BitXor<usize> for Mint {
        type Output = Self;
        fn bitxor(self, other: usize) -> Self {
            self ^ Mint::from(other)
        }
    }

    impl BitXorAssign<usize> for Mint {
        fn bitxor_assign(&mut self, other: usize) {
            *self ^= Mint::from(other);
        }
    }

    impl From<usize> for Mint {
        fn from(item: usize) -> Self {
            Mint::from((item % (MOD as usize)) as i32)
        }
    }

    impl fmt::Display for Mint {
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
            write!(f, "{}", self.val)
        }
    }
}

fn main() {
    input! {
        n: usize,
        h: usize,
        d: usize,
    }

    let mut f = vec![mint::ONE; n + 1];
    let mut sumf = vec![mint::ZERO; n + 1];
    for i in 0..n {
        f[i + 1] = f[i] * mint::Mint::from(i + 1);
    }
    for i in 0..n {
        sumf[i + 1] = sumf[i] + f[i + 1];
    }

    let mut dp = vec![mint::ZERO; h + 2];
    dp[1] += mint::ONE;
    dp[d + 1] -= mint::ONE;
    for i in 1..h {
        let l = i + 1;
        let u = std::cmp::min(h, i + d) + 1;

        let v = dp[i];
        dp[l] += v * sumf[n] + v;
        dp[u] -= v * sumf[n];
    }
    // eprintln!("{:?}", f);
    // eprintln!("{:?}", sumf);
    // eprintln!("{:?}", dp);
    println!("{}", dp[h] * f[n]);
}


Measured memory_bytes: 16636