#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10, mod = 1e9 + 7;
long long par[maxn], fact[maxn], ans;
int n, k;
long long power(long long b, int e) {
  return e ? power(b * b % mod, e >> 1) * (e & 1 ? b : 1) % mod : 1;
}
int main() {
  fact[0] = 1;
  for (int i = 1; i < maxn; ++i) fact[i] = fact[i - 1] * i % mod;
  cin >> n >> k;
  for (int i = k + 1; i <= n; ++i) {
    long long d = par[i - 1] - par[i - k - 1];
    d += i - k - 1;
    d = d * power(fact[i - 1], mod - 2) % mod;
    d = d * fact[i - 2] % mod;
    if (d < 0) d += mod;
    par[i] = (par[i - 1] + d) % mod;
  }
  ans = par[n] * fact[n - 1] % mod;
  cout << ans << '\n';
  return 0;
}
