#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int N = 1e6 + 50;
int n, k, g[N], inv[N], Sum, Ans, fac;
int main() {
  scanf("%d%d", &n, &k);
  g[0] = fac = 1;
  Ans = n;
  for (int i = 1; i <= n; i++) {
    inv[i] = (-1ll * (mod / i) * inv[mod % i] % mod + mod + (i == 1)) % mod;
    Sum = (Sum + g[i - 1]) % mod;
    if (i > k) Sum = (Sum - g[i - k - 1] + mod) % mod;
    g[i] = 1ll * Sum * inv[i] % mod;
    Ans = (Ans - g[i - 1] + mod) % mod;
    if (i != 1) fac = 1ll * fac * (i - 1) % mod;
  }
  printf("%d\n", 1ll * fac * Ans % mod);
}
