#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline int read() {
  int w = 1, s = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return w * s;
}
int n, k, fac[1001000], Ifac[1001000], f[1000010], Sum[1010010];
inline long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
inline int add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int A(int a, int b) { return 1ll * fac[a] * Ifac[a - b] % mod; }
inline void Init() {
  fac[0] = Ifac[0] = 1;
  for (register int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  Ifac[n] = ksm(fac[n], mod - 2);
  for (register int i = n - 1; i; --i)
    Ifac[i] = 1ll * Ifac[i + 1] * (i + 1) % mod;
}
int main() {
  n = read(), k = read();
  Init();
  for (register int i = k + 1; i <= n; ++i) {
    int tmp = 1ll * max(i - k - 1, 0) * fac[i - 2] % mod;
    f[i] = add(f[i], tmp);
    int l = max(i - k, 1);
    f[i] =
        add(f[i], 1ll * fac[i - 2] * add(Sum[i - 1], mod - Sum[l - 1]) % mod);
    Sum[i] = add(Sum[i - 1], 1ll * f[i] * Ifac[i - 1] % mod);
  }
  cout << 1ll * Sum[n] * fac[n - 1] % mod;
  return 0;
}
