func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1E6 + 50;   const long long p = 1E9 + 7;   int n, k;   long long ans, sum, f[N], s[N], fac[N], inv[N];   inline void upd(long long &a, long long b) {     a += b;     if (a >= p) a -= p;   }   inline void sub(long long &a, long long b) {     a -= b;     if (a < 0) a += p;   }   long long Pow(long long a, long long b = p - 2) {     long long res = 1;     for (; b; b >>= 1, a = a * a % p)       if (b & 1) res = res * a % p;     return res;   }   void init() {     fac[0] = inv[0] = 1;     for (register int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % p;     inv[n] = Pow(fac[n]);     for (register int i = n - 1; i; --i) inv[i] = inv[i + 1] * (i + 1) % p;   }   int main() {     scanf( %d%d , &n, &k);     if (k >= n) return 0 * printf( 0 n );     init();     f[0] = s[0] = 1;     for (register int i = 1; i <= k; ++i) {       f[i] = fac[i], s[i] = 1;       upd(sum, s[i]);     }     for (register int i = k + 1; i <= n; ++i) {       f[i] = sum * fac[i - 1] % p;       s[i] = f[i] * inv[i] % p;       upd(sum, s[i]), sub(sum, s[i - k]);     }     for (int i = 0; i < n - k; ++i) sub(ans, s[i]);     ans = ans * fac[n - 1] % p;     sub(ans, f[n]);     upd(ans, fac[n]);     printf( %lld n , ans);     return 0;   }   