#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7;
const long long MOD = 1e9 + 7;
long long n, k, res;
long long fact[N];
long long inv[N];
long long dp[N];
long long pref[N];
long long fpow(long long a, long long b) {
  long long res = 1;
  for (long long i = 0; i < 30; ++i) {
    if (b & (1 << i)) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
long long dwumian(long long n, long long k) {
  return fact[n] * inv[k] % MOD * inv[n - k] % MOD;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  fact[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i < N; ++i) {
    fact[i] = fact[i - 1] * i % MOD;
    inv[i] = fpow(fact[i], MOD - 2);
  }
  cin >> n >> k;
  dp[1] = 1;
  pref[1] = 1;
  for (long long i = 2; i <= n; ++i) {
    dp[i] = fact[i - 2] * (pref[i - 1] - pref[max(0ll, i - k - 1)] + MOD) % MOD;
    pref[i] = (pref[i - 1] + dp[i] * inv[i - 1]) % MOD;
  }
  for (long long i = 1; i <= n; ++i) {
    res += dp[i] * dwumian(n - 1, i - 1) % MOD * fact[n - i] % MOD;
    res %= MOD;
  }
  cout << (fact[n] - res + MOD) % MOD;
}
