func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1000005;   long long fac[N], dp[N];   int mod = 1000000007;   long long pow(int a, int b, int MOD) {     long long x = 1, y = a;     while (b > 0) {       if (b % 2 == 1) {         x = (x * y);         if (x > MOD) x %= MOD;       }       y = (y * y);       if (y > MOD) y %= MOD;       b /= 2;     }     return x % MOD;   }   long long ncr(int n, int r) {     long long temp = (fac[r] * fac[n - r]) % mod;     return (fac[n] * pow(temp, mod - 2, mod)) % mod;   }   int main() {     int n, i, k;     long long temp;     fac[0] = 1;     for (i = 1; i < N; i++) {       fac[i] = (fac[i - 1] * i) % mod;     }     scanf( %d%d , &n, &k);     for (i = k + 1; i <= n; i++) {       dp[i] = (i * dp[i - 1]) % mod;       temp = (fac[k] * ncr(i - 1, k)) % mod;       dp[i] += (((fac[i - k - 1] - dp[i - k - 1]) % mod + mod) * temp) % mod;       dp[i] %= mod;     }     long long ans = 0;     for (i = 1; i <= n; i++) {       temp = (ncr(n - 1, i - 1) * dp[i - 1]) % mod;       temp = (temp * fac[n - i]) % mod;       ans += temp;       ans %= mod;     }     printf( %lld , ans);   }   