#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
void solve(bool);
void precalc();
clock_t start;
int main() {
  start = clock();
  int t = 1;
  cout.sync_with_stdio(0);
  cin.tie(0);
  precalc();
  cout.precision(10);
  cout << fixed;
  int testNum = 1;
  while (t--) {
    solve(true);
  }
  cout.flush();
  return 0;
}
template <typename T>
T binpow(T q, T w, T mod) {
  if (!w) return 1 % mod;
  if (w & 1) return q * 1LL * binpow(q, w - 1, mod) % mod;
  return binpow(q * 1LL * q % mod, w / 2, mod);
}
template <typename T>
T gcd(T q, T w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
template <typename T>
T lcm(T q, T w) {
  return q / gcd(q, w) * w;
}
template <typename T>
void make_unique(vector<T>& a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
template <typename T>
void relax_min(T& cur, T val) {
  cur = min(cur, val);
}
template <typename T>
void relax_max(T& cur, T val) {
  cur = max(cur, val);
}
void precalc() {}
const long long mod = 1000000007;
const long long C = 1000500;
long long fact[C], revfact[C];
void solve(bool read) {
  fact[0] = 1;
  for (long long i = 1; i < C; ++i) {
    fact[i] = fact[i - 1] * i % mod;
  }
  revfact[C - 1] = binpow(fact[C - 1], mod - 2, mod);
  for (long long i = C - 2; i >= 0; --i) {
    revfact[i] = revfact[i + 1] * (i + 1) % mod;
  }
  long long n, k;
  cin >> n >> k;
  if (k >= n) {
    cout << "0\n";
    return;
  }
  vector<long long> dp(n + 1, 0);
  long long cur_sum = 0;
  for (long long i = 0; i <= k; ++i) {
    dp[i] = fact[i - 1];
    if (i) {
      cur_sum += dp[i] * revfact[i - 1];
      cur_sum %= mod;
    }
  }
  for (long long i = k + 1; i <= n; ++i) {
    dp[i] = cur_sum * fact[i - 2] % mod;
    cur_sum -= dp[i - k] * revfact[i - k - 1];
    cur_sum += dp[i] * revfact[i - 1];
    cur_sum %= mod;
    if (cur_sum < 0) {
      cur_sum += mod;
    }
  }
  long long res = 0;
  for (long long i = 1; i <= n; ++i) {
    res += dp[i] * fact[n - 1] % mod * revfact[i - 1] % mod;
    res %= mod;
  }
  res = fact[n] - res;
  res %= mod;
  if (res < 0) {
    res += mod;
  }
  cout << res << "\n";
}
