#include <bits/stdc++.h>
const int N = 1000010, mod = 1000000007;
int n, k, fac[N], Inv[N], sum, f[N], res;
int ksm(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % mod;
    a = 1LL * a * a % mod;
    b >>= 1;
  }
  return ans;
}
int C(int n, int m) { return 1LL * fac[n] * Inv[m] % mod * Inv[n - m] % mod; }
int main() {
  scanf("%d%d", &n, &k);
  fac[0] = Inv[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1LL * fac[i - 1] * i % mod;
  Inv[N - 1] = ksm(fac[N - 1], mod - 2);
  for (int i = N - 2; i >= 1; i--) Inv[i] = 1LL * Inv[i + 1] * (i + 1) % mod;
  f[0] = 1;
  sum = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = 1LL * fac[i - 1] * sum % mod;
    sum = (sum + 1LL * f[i] * Inv[i] % mod) % mod;
    if (i - k >= 0) sum = (sum - 1LL * f[i - k] * Inv[i - k] % mod + mod) % mod;
  }
  for (int i = 1; i <= n; i++) {
    res =
        (res + 1LL * f[i - 1] * C(n - 1, n - i) % mod * fac[n - i] % mod) % mod;
  }
  printf("%d", (fac[n] - res + mod) % mod);
  return 0;
}
