#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
int fac[1000005], inv[1000005];
void initfac(int n) {
  fac[0] = inv[0] = 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    fac[i] = (long long)fac[i - 1] * i % 1000000007;
    inv[i] = fastPow(fac[i], 1000000007 - 2);
  }
}
int C(int n, int m) {
  if (n < m) return 0;
  return (long long)fac[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
int D[1000005], psd[1000005];
void fmain(int ID) {
  scanf("%d%d", &n, &k);
  initfac(n);
  int ans = 0;
  for (int i = k + 2; i <= n; i++) {
    D[i] = (long long)(i - k - 1) * fac[i - 2] % 1000000007;
    addmod(D[i], (long long)(psd[i - 1] + 1000000007 - psd[i - k - 1]) %
                     1000000007 * fac[i - 2] % 1000000007);
    psd[i] = (long long)D[i] * inv[i - 1] % 1000000007;
    addmod(psd[i], psd[i - 1]);
  }
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    addmod(ans,
           (long long)D[i] * fac[n - 1] % 1000000007 * inv[i - 1] % 1000000007);
  }
  printf("%d\n", ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
