#include <bits/stdc++.h>
long long in() {
  char ch;
  long long x = 0, f = 1;
  while (!isdigit(ch = getchar())) (ch == '-') && (f = -f);
  for (x = ch ^ 48; isdigit(ch = getchar());
       x = (x << 1) + (x << 3) + (ch ^ 48))
    ;
  return x * f;
}
const int maxn = 5e6 + 10;
const int mod = 1e9 + 7;
int n, k;
long long fac[maxn], inv[maxn];
long long f[maxn], s[maxn];
long long ksm(long long x, long long y) {
  long long re = 1LL;
  while (y) {
    if (y & 1) re = re * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return re;
}
int main() {
  n = in(), k = in();
  fac[0] = 1;
  for (long long i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % mod;
  inv[n] = ksm(fac[n], mod - 2);
  for (long long i = n - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
  f[0] = s[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] =
        (fac[i - 1] * (s[i - 1] - (i - k - 1 >= 0 ? s[i - k - 1] : 0) + mod)) %
        mod;
    s[i] = (f[i] * inv[i] % mod + s[i - 1]) % mod;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    (ans += fac[n - 1] * f[i - 1] % mod * inv[i - 1] % mod) %= mod;
  printf("%lld", (fac[n] - ans + mod) % mod);
  return 0;
}
