#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long mod_inv(long long x) {
  long long ans = 1, base = x, exp = mod - 2;
  while (exp) {
    if (exp & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    exp >>= 1;
  }
  return ans;
}
long long N, K, fact[1000005], invfact[1000005], dp[1000005], prefdp[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  fact[0] = invfact[0] = 1;
  for (long long i = 1; i <= 1000000; ++i) {
    fact[i] = (i * fact[i - 1]) % mod;
    invfact[i] = mod_inv(fact[i]);
  }
  cin >> N >> K;
  for (long long i = 1; i <= K; ++i) {
    dp[i] = 0;
    prefdp[i] = 0;
  }
  for (long long i = K + 1; i <= N; ++i) {
    dp[i] = fact[i - 2] * (prefdp[i - 1] - prefdp[i - K - 1] + (i - K - 1));
    dp[i] %= mod;
    dp[i] += mod;
    dp[i] %= mod;
    prefdp[i] = prefdp[i - 1] + (dp[i] * invfact[i - 1]);
    prefdp[i] %= mod;
  }
  long long ans = 0;
  for (long long i = 1; i <= N; ++i) {
    ans += ((dp[i] * fact[N - 1]) % mod) * invfact[i - 1];
    ans %= mod;
  }
  cout << ans << '\n';
}
