#include <bits/stdc++.h>
using namespace std;
const long long N = 1000005;
const long long MOD = 1e9 + 7;
long long n, k;
long long inv[N], JC[N];
long long Pow(long long x, long long y) {
  if (y == 1) return x;
  long long lalal = Pow(x, y >> 1);
  lalal = lalal * lalal % MOD;
  if (y & 1) lalal = lalal * x % MOD;
  return lalal;
}
long long C(long long x, long long y) {
  return JC[x] * inv[y] % MOD * inv[x - y] % MOD;
}
long long f[N], g[N];
int main() {
  scanf("%lld%lld", &n, &k);
  JC[0] = 1;
  for (long long u = 1; u <= n; u++) JC[u] = JC[u - 1] * u % MOD;
  inv[n] = Pow(JC[n], MOD - 2);
  for (long long u = n - 1; u >= 0; u--) inv[u] = inv[u + 1] * (u + 1) % MOD;
  for (long long u = 0; u <= k; u++) {
    f[u] = 0;
    g[u] = JC[u];
  }
  for (long long u = k + 1; u <= n; u++) {
    f[u] =
        (f[u - 1] * u % MOD + g[u - k - 1] * C(u - 1, k) % MOD * JC[k] % MOD) %
        MOD;
    g[u] = (JC[u] - f[u]) % MOD;
  }
  long long ans = 0;
  for (long long u = n; u >= 1; u--) {
    ans = (ans + C(n - 1, u - 1) * f[u - 1] % MOD * JC[n - u] % MOD) % MOD;
  }
  ans = (ans + MOD) % MOD;
  printf("%lld\n", ans);
  return 0;
}
