#include <bits/stdc++.h>
using namespace std;
const int N = 1000006;
const int mod = 1000000007;
int n, k;
int fac[N], inv[N], f[N], s[N];
int qui(int a, int b) {
  int s = 1;
  while (b) {
    if (b & 1) s = 1LL * s * a % mod;
    a = 1LL * a * a % mod;
    b >>= 1;
  }
  return s;
}
int main() {
  scanf("%d%d", &n, &k);
  fac[0] = 1;
  for (register int i = 1; i <= n; ++i) fac[i] = 1LL * fac[i - 1] * i % mod;
  inv[n] = qui(fac[n], mod - 2);
  for (register int i = n; i >= 1; --i) inv[i - 1] = 1LL * inv[i] * i % mod;
  f[0] = 1;
  s[1] = 1;
  for (register int i = 1; i < n; ++i) {
    f[i] = (s[i] - s[max(i - k, 0)] + mod) % mod;
    f[i] = 1LL * f[i] * fac[i - 1] % mod;
    s[i + 1] = (s[i] + 1LL * f[i] * inv[i]) % mod;
  }
  f[n] = 1LL * s[n] * fac[n - 1] % mod;
  printf("%d", (fac[n] - f[n] + mod) % mod);
  return 0;
}
