#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005, mod = 1e9 + 7;
inline int gi() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum;
}
int n, k, f[maxn], fac[maxn], ifac[maxn];
int main() {
  n = gi();
  k = gi();
  fac[0] = ifac[0] = ifac[1] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = (long long)fac[i - 1] * i % mod;
  for (int i = 2; i <= n; ++i)
    ifac[i] = (long long)(mod - mod / i) * ifac[mod % i] % mod;
  for (int i = 1; i <= n; ++i) ifac[i] = (long long)ifac[i - 1] * ifac[i] % mod;
  int sum = 0, ans = 0;
  f[1] = sum = 1;
  for (int i = 2; i <= n; ++i) {
    if (i > k + 1)
      sum = (sum + (long long)(mod - f[i - k - 1]) * ifac[i - k - 2]) % mod;
    f[i] = (long long)sum * fac[i - 2] % mod;
    sum = (sum + (long long)f[i] * ifac[i - 1]) % mod;
  }
  for (int i = 1; i <= n; ++i)
    ans = (ans + (long long)f[i] * fac[n - 1] % mod * ifac[i - 1]) % mod;
  printf("%d\n", (fac[n] - ans + mod) % mod);
  return 0;
}
