#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int my_power(int a, int b) {
  int answer = 1;
  while (b > 0) {
    if (b % 2 == 1) answer = (long long)answer * a % MOD;
    a = (long long)a * a % MOD;
    b /= 2;
  }
  return answer;
}
int main() {
  int n, k;
  cin >> n >> k;
  if (k >= n) {
    cout << "0\n";
    return 0;
  }
  assert(n > 1);
  vector<int> fact(n + 1), fact_inv(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = (long long)i * fact[i - 1] % MOD;
  fact_inv[n] = my_power(fact[n], MOD - 2);
  for (int i = n - 1; i >= 0; --i)
    fact_inv[i] = (long long)(i + 1) * fact_inv[i + 1] % MOD;
  vector<int> dp(n + 1);
  vector<int> dp_sum(n + 1);
  for (int i = k + 1; i <= n; i++) {
    dp[i] = (long long)(i - k - 1) * fact[i - 2] % MOD;
    int low = i - k - 1;
    int high = i - 1;
    dp[i] += (long long)fact[i - 2] * (dp_sum[high] - dp_sum[low] + MOD) % MOD;
    if (dp[i] >= MOD) dp[i] -= MOD;
    dp_sum[i] = (long long)dp[i] * fact_inv[i - 1] % MOD + dp_sum[i - 1];
    if (dp_sum[i] >= MOD) dp_sum[i] -= MOD;
  }
  int answer = 0;
  for (int pos = 1; pos <= n; pos++) {
    answer += (long long)fact[n - 1] * fact_inv[pos - 1] % MOD * dp[pos] % MOD;
    if (answer >= MOD) answer -= MOD;
  }
  cout << answer << "\n";
  return 0;
}
