#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5, mod = 1e9 + 7;
long long fac[N], inv[N], good[N], bad[N];
int n, k;
long long bp(long long a, long long p) {
  long long r = 1;
  while (p > 0) {
    if (p & 1) r = r * a % mod;
    a = a * a % mod;
    p >>= 1;
  }
  return r;
}
long long c(int n, int k) { return fac[n] * inv[k] % mod * inv[n - k] % mod; }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fac[0] = inv[0] = 1;
  for (int i = 1; i < N; i++) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = bp(fac[i], mod - 2);
  }
  cin >> n >> k;
  long long sum = 0;
  for (int i = 0; i + 1 + k <= n; i++) {
    sum = (sum + bad[i] * inv[i]) % mod;
    good[i] = (fac[i] - sum * fac[i] % mod + mod) % mod;
    if (i + 1 + k <= n) {
      bad[i + 1 + k] =
          (bad[i + 1 + k] + good[i] * c(i + k, k) % mod * fac[k]) % mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans = (ans + bad[i] % mod * c(n - 1, i) % mod * fac[n - i]) % mod;
  }
  cout << ans;
  return 0;
}
