#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long int mod = 1000000007;
const int N = 1000005;
long long int fact[N], invfact[N];
long long int ans1[N], ans2[N], pref[N];
long long int powmod(long long int a, long long int b) {
  if (b == 0LL) return 1LL;
  long long int ret = powmod(a, b / 2);
  ret = (ret * ret) % mod;
  if (b % 2 == 1) ret = (ret * a) % mod;
  return ret;
}
int main() {
  int n, k;
  cin >> n >> k;
  fact[0] = 1;
  invfact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    invfact[i] = powmod(fact[i], mod - 2);
  }
  ans2[0] = 1;
  pref[0] = 1;
  for (int i = 1; i <= n; i++) {
    long long int tmp = (pref[i - 1] * fact[i - 1]) % mod;
    ans1[i] = tmp;
    if (i - k - 1 < 0)
      ans2[i] = ans1[i];
    else {
      tmp = (pref[i - 1] - pref[i - k - 1] + mod) % mod;
      ans2[i] = (tmp * fact[i - 1]) % mod;
    }
    ans2[i] = (ans2[i] * invfact[i]) % mod;
    pref[i] = (pref[i - 1] + ans2[i]) % mod;
  }
  cout << (fact[n] - ans1[n] + mod) % mod << "\n";
  return 0;
}
