#include <bits/stdc++.h>
using namespace std;
const long long N = 1000005;
const long long M = 205;
const long long INF = 0x3f3f3f3f;
const double Pi = acos(-1);
const long long MOD = 1e9 + 7;
const double eps = 1e-8;
long long n, m;
long long k;
long long dp[N];
long long pre[N];
long long fac[N];
void ini() {
  fac[1] = 1;
  for (long long i = 2; i < N; i++) fac[i] = (fac[i - 1] * i) % MOD;
}
long long qpow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    n >>= 1;
  }
  return res % MOD;
}
long long inv(long long x) { return qpow(x, MOD - 2); }
int main() {
  ini();
  while (~scanf("%I64d%I64d", &n, &k)) {
    memset(dp, 0, sizeof dp);
    memset(pre, 0, sizeof pre);
    for (long long i = 1; i <= n; i++) {
      if (i <= k || i <= 2) continue;
      dp[i] = (i - k - 1) * fac[i - 2] % MOD +
              fac[i - 2] * (pre[i - 1] - pre[i - k - 1] + MOD) % MOD;
      pre[i] = (pre[i - 1] + dp[i] * inv(fac[i - 1])) % MOD;
    }
    long long ans = 0;
    for (long long i = 1; i <= n; i++)
      ans = (ans + (dp[i] * fac[n - 1]) % MOD * inv(fac[i - 1])) % MOD;
    printf("%I64d\n", ans);
  }
  return 0;
}
