#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010, mod = 1e9 + 7;
int n, k, fac[maxn], ifac[maxn], f[maxn], g[maxn];
void upd(int& x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  scanf("%d %d", &n, &k);
  fac[0] = fac[1] = ifac[0] = ifac[1] = 1;
  for (int i = (int)2; i <= (int)n; i++)
    fac[i] = 1ll * fac[i - 1] * i % mod,
    ifac[i] = 1ll * (mod - mod / i) * ifac[mod % i] % mod;
  for (int i = (int)2; i <= (int)n; i++)
    ifac[i] = 1ll * ifac[i - 1] * ifac[i] % mod;
  for (int i = (int)k + 1; i <= (int)n; i++) {
    f[i] =
        (1ll * fac[i - 2] * (i - k - 1 + g[i - 1] - g[i - k - 1]) % mod + mod) %
        mod;
    g[i] = (g[i - 1] + 1ll * f[i] * ifac[i - 1] % mod) % mod;
  }
  printf("%d\n", 1ll * fac[n - 1] * g[n] % mod);
  return 0;
}
