#include <bits/stdc++.h>
using namespace std;
namespace my_std {
const long long inf = 0x3f3f3f3f;
const long long inff = 1e15;
inline long long read() {
  long long sum = 0, f = 1;
  char ch = 0;
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    sum = sum * 10 + (ch ^ 48);
    ch = getchar();
  }
  return sum * f;
}
inline void write(long long x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  putchar('\n');
}
inline void writesp(long long x) {
  write(x);
  putchar(' ');
}
}  // namespace my_std
using namespace my_std;
const long long N = 1e6 + 50, mod = 1e9 + 7;
long long n, k, mul[N], inv[N], f[N], s[N];
inline long long ksmod(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % mod;
    }
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
inline void init(long long n) {
  mul[0] = inv[0] = 1;
  for (long long i = 1; i <= n; i++) mul[i] = (mul[i - 1] * i) % mod;
  inv[n] = ksmod(mul[n], mod - 2);
  for (long long i = n - 1; i; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}
inline long long C(long long n, long long m) {
  if (m > n || m < 0 || n < 0) return 0;
  long long res = inv[m] * inv[n - m] % mod;
  res = res * mul[n] % mod;
  return res;
}
int main(void) {
  n = read(), k = read();
  init(n);
  f[0] = s[0] = 1;
  for (register long long i = (1); i <= (n); ++i) {
    if (i - k - 1 >= 0)
      f[i] = mul[i - 1] * (s[i - 1] - s[i - k - 1] + mod) % mod;
    else
      f[i] = mul[i - 1] * s[i - 1] % mod;
    s[i] = (s[i - 1] + f[i] * inv[i]) % mod;
  }
  long long ans = 0;
  for (register long long i = (1); i <= (n); ++i)
    ans = (ans + f[i - 1] * mul[n - 1] % mod * inv[i - 1] % mod) % mod;
  writeln((mul[n] - ans + mod) % mod);
  return 0;
}
