#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, k;
long long bp(long long a, long long p) {
  long long r = 1;
  while (p > 0) {
    if (p & 1) r = r * a % mod;
    a = a * a % mod;
    p >>= 1;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  vector<long long> fac(n + 1), inv(n + 1), good(n + 1), bad(n + 1);
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = bp(fac[i], mod - 2);
  }
  for (int i = 0; i <= min(k, n); ++i) {
    good[i] = fac[i];
    bad[i] = fac[i];
  }
  for (int i = k + 1; i <= n; ++i) {
    good[i] = (good[i - 1] * (i - 1) % mod + bad[i - 1]) % mod;
    bad[i] =
        (bad[i - 1] + (i - 1) * (bad[i - 1] - bad[i - k - 1] * fac[i - 2] %
                                                  mod * inv[i - 1 - k] % mod)) %
        mod;
  }
  cout << (fac[n] + mod - good[n]) % mod << endl;
  return 0;
}
