#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
const int MOD = 1e9 + 7;
long long po(long long v, long long u) {
  return u ? (po(v * v % MOD, u >> 1) * (u & 1 ? v : 1) % MOD) : 1;
}
long long n, k, fac[MAXN], ans, dp[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k;
  fac[0] = 1;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = i * dp[i - 1] % MOD;
    if (i > k) {
      long long me =
          dp[i - 1 - k] * fac[i - 1] % MOD * po(fac[i - 1 - k], MOD - 2) % MOD;
      dp[i] += MOD - me;
      dp[i] %= MOD;
    }
    ans += dp[i - 1] * fac[n - 1] % MOD * po(fac[i - 1], MOD - 2) % MOD;
    ans %= MOD;
  }
  cout << (fac[n] - ans + MOD) % MOD << endl;
  cin >> n;
  return 0;
}
