#include <bits/stdc++.h>
using namespace std;
int fast_max(const vector<int>& A, int k) {
  int ans = 0;
  int offset = 0;
  int n = A.size();
  for (int i = 0; i < n; ++i) {
    if (ans < A[i]) {
      ans = A[i];
      offset = 0;
    } else {
      offset = offset + 1;
      if (offset == k) return ans;
    }
  }
  return ans;
}
long long modpow(long long x, long long y) {
  long long xs = x;
  long long answer = 1;
  while (y) {
    if (y & 1) {
      answer = (answer * xs) % 1000000007;
    }
    y >>= 1;
    xs = (xs * xs) % 1000000007;
  }
  return answer;
}
long long PS[1111111];
long long PS_cumul[1111111];
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i <= k; i++) {
    PS[i] = 0;
    PS_cumul[i] = 0;
  }
  long long ninv = modpow(n, 1000000007 - 2);
  long long ans = 0;
  for (int m = k + 1; m <= n; m++) {
    PS[m] = modpow(m, 1000000007 - 2) * (1 - PS_cumul[m - 1 - k]) % 1000000007;
    if (PS[m] < 0) PS[m] += 1000000007;
    PS_cumul[m] = (PS_cumul[m - 1] + PS[m]) % 1000000007;
    long long curr = (1 - PS_cumul[m - k - 1]) * (n - m) % 1000000007;
    if (curr < 0) curr += 1000000007;
    curr = (curr * ninv) % 1000000007;
    curr = (curr * modpow(m, 1000000007 - 2)) % 1000000007;
    ans += curr;
    ans %= 1000000007;
  }
  long long fact = 1;
  for (int i = 1; i <= n; i++) fact = (fact * i) % 1000000007;
  ans = (ans * fact) % 1000000007;
  if (ans < 0) ans += 1000000007;
  cout << ans << endl;
}
