#include <bits/stdc++.h>
using namespace std;
int _max(int x, int y) { return x > y ? x : y; }
const long long mod = 1e9 + 7;
int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * f;
}
long long inv[1000010], jc[1000010];
long long f[1000010], sum[1000010];
long long pow_mod(long long a, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) (ans *= a) %= mod;
    (a *= a) %= mod;
    k /= 2;
  }
  return ans;
}
long long C(long long n, long long m) {
  return jc[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  int n = read(), k = read();
  jc[0] = 1;
  for (int i = 1; i <= n; i++) jc[i] = (long long)jc[i - 1] * i % mod;
  inv[0] = 1;
  inv[n] = pow_mod(jc[n], mod - 2);
  for (int i = n - 1; i >= 1; i--)
    inv[i] = (long long)inv[i + 1] * (i + 1) % mod;
  sum[1] = 1;
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = (sum[i] - sum[_max(0, i - k)]) % mod * jc[i - 1] % mod;
    (sum[i + 1] = sum[i] + f[i] * inv[i] % mod) % mod;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    (ans += f[i - 1] * C(n - 1, i - 1) % mod * jc[n - i] % mod) % mod;
  printf("%lld\n", ((jc[n] - ans) % mod + mod) % mod);
  return 0;
}
