#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAXN = 1e6 + 10;
inline long long pow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % MOD;
    b >>= 1;
    a = a * a % MOD;
  }
  return ans;
}
long long n, k;
long long fact[MAXN], antifact[MAXN], D[MAXN], pre_D[MAXN];
void Init() {
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= MAXN - 10; i++) fact[i] = fact[i - 1] * i % MOD;
  for (int i = 0; i <= MAXN - 10; i++) antifact[i] = pow(fact[i], MOD - 2);
}
int main() {
  ios::sync_with_stdio(false);
  Init();
  cin >> n >> k;
  if (k >= n) {
    cout << 0 << endl;
    return 0;
  }
  memset(D, 0, sizeof(D));
  memset(pre_D, 0, sizeof(pre_D));
  D[k + 2] = fact[k];
  pre_D[k + 2] = D[k + 2] * antifact[k + 1] % MOD;
  for (int i = k + 3; i <= n; i++) {
    D[i] = (i - k - 1) * fact[i - 2] % MOD +
           fact[i - 2] * (pre_D[i - 1] - pre_D[i - k - 1]) % MOD;
    D[i] %= MOD;
    if (D[i] < 0) D[i] += MOD;
    pre_D[i] = (pre_D[i - 1] + D[i] * antifact[i - 1] % MOD) % MOD;
    if (pre_D[i] < 0) pre_D[i] += MOD;
  }
  long long ans = fact[n - 1] * pre_D[n] % MOD;
  cout << ans << endl;
  return 0;
}
