#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
const int mod = 1e9 + 7;
long long n, k, ans;
long long inv[MAXN], fac[MAXN], f[MAXN], sum[MAXN];
inline long long qpow(long long num, long long ks) {
  long long ret = 1;
  while (ks) {
    if (ks & 1) ret = ret * num % mod;
    num = num * num % mod;
    ks >>= 1;
  }
  return ret;
}
inline void init() {
  scanf("%I64d%I64d", &n, &k);
  fac[0] = 1;
  for (long long i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
  inv[n] = qpow(fac[n], mod - 2);
  for (long long i = n - 1; i >= 0; --i)
    inv[i] = (long long)inv[i + 1] * (i + 1) % mod;
}
inline void solve() {
  if (n <= k + 1) {
    printf("0\n");
    return;
  }
  for (long long i = k + 2; i <= n; i++) {
    f[i] = (i - k - 1 + (sum[i - 1] - sum[i - k - 1] + mod) % mod) % mod;
    f[i] = f[i] * fac[i - 2] % mod;
    sum[i] = (sum[i - 1] + f[i] * inv[i - 1] % mod) % mod;
    long long tmp = (f[i] * fac[n - 1] % mod) * inv[i - 1] % mod;
    ans = (ans + tmp) % mod;
  }
  printf("%I64d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
