#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int add(int a, int b) { return a + b >= Mod ? a + b - Mod : a + b; }
int dec(int a, int b) { return a - b < 0 ? a - b + Mod : a - b; }
int mul(int a, int b) { return 1ll * a * b % Mod; }
void Add(int &a, int b) { a = add(a, b); }
void Dec(int &a, int b) { a = dec(a, b); }
void Mul(int &a, int b) { a = mul(a, b); }
int ksm(int a, int b) {
  int as = 1;
  for (; b; b >>= 1, Mul(a, a))
    if (b & 1) Mul(as, a);
  return as;
}
const int N = 1e6 + 50;
int n, k, fc[N], ifc[N], dp[N], iv[N];
void fc_init() {
  fc[0] = fc[1] = ifc[0] = ifc[1] = 1;
  for (int i = 2; i <= n; i++) fc[i] = mul(fc[i - 1], i);
  ifc[n] = ksm(fc[n], Mod - 2);
  for (int i = n - 1; i >= 2; i--) ifc[i] = mul(ifc[i + 1], i + 1);
  iv[0] = iv[1] = 1;
  for (int i = 2; i <= n; i++) iv[i] = mul(Mod - Mod / i, iv[Mod % i]);
}
int main() {
  scanf("%d%d", &n, &k);
  fc_init();
  dp[0] = 1;
  int Ans = 1;
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1];
    if (i - k - 1 >= 0) Dec(dp[i], dp[i - k - 1]);
    Mul(dp[i], iv[i]);
    if (i < n) Add(Ans, dp[i]);
    Add(dp[i], dp[i - 1]);
  }
  cout << dec(fc[n], mul(fc[n - 1], Ans));
  return 0;
}
