#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e6 + 10;
const int MOD = (int)1e9 + 7;
int n, k;
int dp[N];
int second[N];
int fact[N];
int inv[N];
int bin(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = (res * 1ll * a) % MOD;
    b >>= 1;
    a = (a * 1ll * a) % MOD;
  }
  return res;
}
int cnk(int n, int k) {
  if (k < 0 || k > n) return 0;
  int res = fact[n];
  res = res * 1ll * bin(fact[k], MOD - 2) % MOD;
  res = res * 1ll * bin(fact[n - k], MOD - 2) % MOD;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = (fact[i - 1] * 1ll * i) % MOD;
  cin >> n >> k;
  dp[0] = 1;
  second[0] = 1;
  for (int i = 1; i <= n; i++) {
    int sum = (second[i - 1] - (i > k ? second[i - k - 1] : 0) + MOD) % MOD;
    sum = sum * 1ll * bin(i, MOD - 2) % MOD;
    dp[i] = sum;
    second[i] = (second[i - 1] + dp[i]) % MOD;
  }
  for (int i = 1; i <= n; i++) dp[i] = dp[i] * 1ll * fact[i] % MOD;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int cur = dp[i - 1] * 1ll * cnk(n - 1, i - 1) % MOD;
    cur = cur * 1ll * fact[n - i] % MOD;
    ans += cur, ans %= MOD;
  }
  cout << (fact[n] - ans + MOD) % MOD;
  return 0;
}
