#include <bits/stdc++.h>
inline long long gi() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
inline int pow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = 1ll * ret * x % 1000000007;
    x = 1ll * x * x % 1000000007;
    y >>= 1;
  }
  return ret;
}
int f[1000010], S[1000010], fact[1000010], ifact[1000010];
int main() {
  int n = gi(), k = gi();
  fact[0] = 1;
  for (int i = 1; i <= n; ++i) fact[i] = 1ll * fact[i - 1] * i % 1000000007;
  ifact[n] = pow(fact[n], 1000000007 - 2);
  for (int i = n; i; --i) ifact[i - 1] = 1ll * ifact[i] * i % 1000000007;
  for (int i = k + 2; i <= n; ++i)
    f[i] = 1ll * fact[i - 2] *
           (0ll + i - k - 1 + S[i - 1] - S[i - k - 1] + 1000000007) %
           1000000007,
    S[i] = (S[i - 1] + 1ll * f[i] * ifact[i - 1]) % 1000000007;
  printf("%d\n", 1ll * fact[n - 1] * S[n] % 1000000007);
  return 0;
}
