#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
inline string readch() {
  string s = " ";
  char ch = getchar();
  s = s + ch;
  while (ch >= 'a' && ch <= 'z') ch = getchar(), s = s + ch;
  return s;
}
const long long MAXN = 1000000;
const long long mod = 1e9 + 7;
long long n, k;
long long fac[MAXN + 5], inv[MAXN + 5], f[MAXN + 5], pre[MAXN + 5];
inline long long qpow(long long x, long long y) {
  long long res = 1ll;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res % mod;
}
inline void Init() {
  fac[0] = fac[1] = 1;
  for (long long i = 2; i <= MAXN; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[MAXN] = qpow(fac[MAXN], mod - 2);
  for (long long i = MAXN - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}
inline long long C(long long x, long long y) {
  return fac[x] * inv[y] % mod * inv[x - y] % mod;
}
signed main() {
  Init();
  n = read(), k = read();
  pre[0] = f[0] = 1;
  for (long long i = 1; i <= n; ++i) {
    f[i] = fac[i - 1] *
           ((pre[i - 1] - (i - k - 1 < 0 ? 0 : pre[i - k - 1]) + mod) % mod) %
           mod;
    pre[i] = (f[i] * inv[i] + pre[i - 1]) % mod;
  }
  long long tot = 0;
  for (long long i = 1; i <= n; ++i) {
    tot = (tot + f[i - 1] * C(n - 1, n - i) % mod * fac[n - i] % mod) % mod;
  }
  printf("%lld\n", (fac[n] - tot + mod) % mod);
  return 0;
}
