func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = 1000000007;   const long double EPS = 1e-11;   const long long INFL = 1e16;   const int INF = 2e9 + 7;   mt19937 rnd((unsigned)chrono::steady_clock::now().time_since_epoch().count());   void add(long long& a, long long b) {     a += b;     while (a >= MOD) {       a -= MOD;     }   }   void sub(long long& a, long long b) { add(a, MOD - b); }   void mul(long long& a, long long b) { a = (a * b) % MOD; }   long long todeg(long long x, long long d) {     if (d < 0) {       d += MOD - 1;     }     if (d == 0) {       return 1;     }     long long ans = todeg(x, d / 2);     mul(ans, ans);     if (d % 2 == 1) {       mul(ans, x);     }     return ans;   }   vector<long long> fact, rfact;   void prep(long long high) {     fact.assign(high + 1, 1);     rfact.resize(high + 1);     for (int i = 1; i <= high; ++i) {       fact[i] = i;       mul(fact[i], fact[i - 1]);     }     rfact[high] = todeg(fact[high], -1);     for (int i = high; i > 0; --i) {       rfact[i - 1] = rfact[i];       mul(rfact[i - 1], i);     }   }   long long C(int n, int k) {     long long ans = fact[n];     mul(ans, rfact[k]);     mul(ans, rfact[n - k]);     return ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     long long n, k;     cin >> n >> k;     prep(n + 5);     vector<long long> sposs(n, 1);     for (int i = 1; i < n; ++i) {       if (i <= k) {         sposs[i] = fact[i];         continue;       }       sposs[i] = sposs[i - 1];       mul(sposs[i], i);       long long del = sposs[i - k - 1];       mul(del, fact[i - 1]);       mul(del, rfact[i - k - 1]);       sub(sposs[i], del);     }     long long ans = fact[n];     for (int i = 0; i < n; ++i) {       long long cv = C(n - 1, i);       mul(cv, sposs[i]);       mul(cv, fact[n - i - 1]);       sub(ans, cv);     }     cout << ans <<   n ;     return 0;   }   