#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, mod = 1e9 + 7;
int dp[N], ps[N];
int fact[N], rev[N];
long long power(int a, int b) {
  if (b == 0) return 1;
  long long res = power(a, b / 2);
  res *= res;
  res %= mod;
  if (b & 1) res *= a, res %= mod;
  return res;
}
int main() {
  int n, k;
  cin >> n >> k;
  if (k >= n) return cout << 0 << endl, 0;
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (1LL * fact[i - 1] * i) % mod;
  rev[N - 1] = power(fact[N - 1], mod - 2);
  for (int i = N - 2; i >= 0; i--) rev[i] = (1LL * rev[i + 1] * (i + 1)) % mod;
  long long ans = 0;
  dp[0] = 1;
  ps[1] = 1;
  ans += fact[n - 1], ans %= mod;
  for (int i = 1; i < n; i++) {
    dp[i] = (ps[i] - ps[max(0, i - k)] + mod) % mod;
    dp[i] = (1LL * dp[i] * fact[i - 1]) % mod;
    long long bad = dp[i];
    bad *= fact[n - 1], bad %= mod;
    bad *= rev[i], bad %= mod;
    ans += bad, ans %= mod;
    dp[i] = (1LL * dp[i] * rev[i]) % mod;
    ps[i + 1] = (ps[i] + dp[i]) % mod;
  }
  cout << (fact[n] + mod - ans) % mod << endl;
}
