#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
const int oo = 1000000000;
const int modulo = 1000000007;
long long n, k;
long long lt[maxn], rev[maxn], f[maxn];
void input() { scanf("%lld %lld", &n, &k); }
long long mod_rev(int first) {
  long long xm = 1, xn = 0, xr;
  int a = first, b = modulo, r, q;
  while (a != 1) {
    q = a / b;
    r = a % b;
    xr = xm - q * xn;
    a = b;
    b = r;
    xm = xn;
    xn = xr;
  }
  return (xm + modulo) % modulo;
}
void init() {
  lt[0] = 1;
  rev[0] = 1;
  for (int i = 1; i <= n; i++) {
    lt[i] = (lt[i - 1] * i) % modulo;
    rev[i] = (rev[i - 1] * mod_rev(i)) % modulo;
  }
}
void solve() {
  long long sum = 1;
  f[0] = 1;
  for (int i = 1; i < n; i++) {
    f[i] = (sum * lt[i - 1]) % modulo;
    sum = (sum + f[i] * rev[i]) % modulo;
    if (i - k >= 0)
      sum = (sum + modulo - f[i - k] * rev[i - k] % modulo) % modulo;
  }
}
void output() {
  long long ans = 0;
  for (int i = 0; i < n; i++)
    ans = (ans + f[i] * lt[n - 1] % modulo * rev[i]) % modulo;
  ans = (lt[n] - ans + modulo) % modulo;
  printf("%lld", ans);
}
int main() {
  std::ios::sync_with_stdio(false);
  input();
  init();
  solve();
  output();
  return (0);
}
