#include <bits/stdc++.h>
using namespace std;
int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
const int N = 1010000;
const long long MOD = 1e9 + 7;
int n, k;
long long inv[N], fac[N], f[N], g[N];
int main() {
  n = read(), k = read();
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n; i++) inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
  for (int i = 1; i <= n; i++) inv[i] = inv[i - 1] * inv[i] % MOD;
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % MOD;
  for (int i = 1; i <= n; i++) {
    if (k >= i) {
      f[i] = 0;
      g[i] = g[i - 1];
      continue;
    }
    f[i] = (fac[i - 2] * (i - k - 1) % MOD +
            fac[i - 2] * (g[i - 1] - g[i - k - 1] + MOD) % MOD) %
           MOD;
    g[i] = (g[i - 1] + f[i] * inv[i - 1]) % MOD;
  }
  printf("%lld\n", g[n] * fac[n - 1] % MOD);
}
