#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const int N = 1000010, Mod = 1e9 + 7;
inline int read() {
  int s = 0, w = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
int n, K, fac[N + 5], inv[N + 5], f[N], qz[N];
inline int ksc(int x, int p) {
  int res = 1;
  for (; p; p >>= 1, x = 1ll * x * x % Mod)
    if (p & 1) res = 1ll * res * x % Mod;
  return res;
}
signed main() {
  fac[0] = 1;
  for (register int i = 1; i <= N; i++) fac[i] = 1ll * fac[i - 1] * i % Mod;
  inv[N] = ksc(fac[N], Mod - 2);
  for (register int i = N; i; i--) inv[i - 1] = 1ll * inv[i] * i % Mod;
  n = read(), K = read();
  f[0] = qz[0] = 1;
  for (register int i = 1; i <= n; i++) {
    int w = qz[i - 1];
    if (i > K) w = (w - qz[i - K - 1] + Mod) % Mod;
    f[i] = 1ll * fac[i - 1] * w % Mod;
    qz[i] = (qz[i - 1] + 1ll * f[i] * inv[i] % Mod) % Mod;
  }
  int ans = 0;
  for (register int i = 1; i <= n; i++) {
    ans = (ans + 1ll * f[i - 1] * fac[n - 1] % Mod * inv[i - 1] % Mod) % Mod;
  }
  printf("%d\n", (fac[n] - ans + Mod) % Mod);
  return 0;
}
