#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int P = 1e9 + 7;
long long factorial[N], inv[N], invfact[N];
long long A[N], B[N];
long long fastpower(long long a, long long n) {
  if (n == 0) return 1;
  long long x = fastpower(a, n / 2);
  if (n % 2 == 0) return (x * x) % P;
  return (((x * x) % P) * a) % P;
}
long long modinverse(long long a) { return fastpower(a, P - 2); }
int main() {
  factorial[0] = 1;
  for (int i = 1; i < N; i++) factorial[i] = (i * factorial[i - 1]) % P;
  for (int i = 0; i < N; i++) {
    inv[i] = modinverse(i);
    invfact[i] = modinverse(factorial[i]);
  }
  int n, k;
  scanf("%d %d", &n, &k);
  if (k > n - 2) {
    cout << "0" << endl;
    return 0;
  }
  long long tot = 0, tmp;
  for (int i = 0; i <= k; i++) {
    A[i] = 0;
    B[i] = factorial[i];
  }
  for (int i = k + 1; i <= n; i++) {
    A[i] = (A[i - 1] +
            ((inv[i] * ((B[i - k - 1] * invfact[i - k - 1]) % P)) % P)) %
           P;
    B[i] = (factorial[i] * (P + 1 - A[i])) % P;
  }
  for (int i = k + 1; i <= n - 1; i++) {
    tmp =
        ((n - i) * ((inv[i] * ((B[i - k - 1] * invfact[i - k - 1]) % P)) % P)) %
        P;
    tot = (tot + tmp) % P;
  }
  tot = (factorial[n - 1] * tot) % P;
  cout << tot << endl;
  return 0;
}
