#include <bits/stdc++.h>
using namespace std;
long long fac[1000100], nifac[1000100], f[1000100], sum[1000100];
long long getmi(int a, int x) {
  long long ans = 1;
  while (x) {
    if (x & 1) ans = ans * a % 1000000007;
    a = (long long)a * a % 1000000007;
    x >>= 1;
  }
  return ans;
}
int main(void) {
  int n, k;
  scanf("%d%d", &n, &k);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % 1000000007;
  nifac[n] = getmi(fac[n], 1000000007 - 2);
  for (int i = n - 1; i >= 0; i--)
    nifac[i] = nifac[i + 1] * (i + 1) % 1000000007;
  f[1] = sum[1] = 1;
  long long ans = fac[n - 1];
  for (int i = 2; i <= n; i++) {
    f[i] = (sum[i - 1] - sum[max(0, i - k - 1)] + 1000000007) * fac[i - 2] %
           1000000007;
    sum[i] = (sum[i - 1] + f[i] * nifac[i - 1]) % 1000000007;
    ans = (ans + f[i] * fac[n - 1] % 1000000007 * nifac[i - 1]) % 1000000007;
  }
  printf("%I64d\n", (fac[n] - ans + 1000000007) % 1000000007);
  return 0;
}
