#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 20, mod = 1e9 + 7;
int n, k, fac[N], rev[N];
int f[N], g[N], b[N];
inline int bpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
inline int c(int n, int k) { return fac[n] * rev[k] % mod * rev[n - k] % mod; }
void pre() {
  fac[0] = rev[0] = 1;
  for (int i = 1; i < N; i++) {
    fac[i] = fac[i - 1] * i % mod;
    rev[i] = bpow(fac[i], mod - 2);
  }
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  pre();
  cin >> n >> k;
  if (k >= n) {
    cout << 0 << '\n';
    return 0;
  }
  for (int i = 0; i <= k; i++) {
    f[i] = 0;
    b[i] = 0;
    g[i] = fac[i];
  }
  f[k + 1] = fac[k];
  b[k + 1] = 0;
  g[k + 1] = fac[k + 1];
  for (int i = k + 2; i <= n; i++) {
    f[i] = (f[i - 1] * i % mod + c(i - 1, i - k - 1) *
                                     (fac[i - k - 1] + mod - f[i - k - 1]) %
                                     mod * fac[k] % mod) %
           mod;
    b[i] = (f[i - 1] + b[i - 1] * (i - 1) % mod) % mod;
    g[i] = (fac[i] + mod - b[i]) % mod;
  }
  cout << b[n] << '\n';
}
