#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long first = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar())
    first = (first << 1) + (first << 3) + (c ^ 48);
  if (f) first = -first;
  return first;
}
const long long Mod = 1e9 + 7;
const long long M = 1e6 + 10;
long long n, k, f[M];
long long fac[M], ifac[M];
long long poww(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % Mod;
    a = a * a % Mod, b >>= 1;
  }
  return res;
}
long long inv(long long first) { return poww(first, Mod - 2); }
long long C(long long m, long long n) {
  return fac[m] * ifac[n] % Mod * ifac[m - n] % Mod;
}
void init(long long n) {
  fac[0] = ifac[0] = 1;
  for (long long i = 1; i <= n; i++)
    fac[i] = fac[i - 1] * i % Mod, ifac[i] = inv(fac[i]);
}
signed main() {
  n = read(), k = read();
  init(n);
  f[0] = 1;
  long long ans = 0, sum = 1;
  for (long long i = 1; i <= n; i++) {
    f[i] = fac[i - 1] * sum % Mod;
    sum += f[i] * ifac[i] % Mod;
    if (i >= k) sum -= f[i - k] * ifac[i - k] % Mod;
    sum = (sum + Mod) % Mod;
  }
  for (long long i = 1; i <= n; i++)
    ans = (ans + f[i - 1] * C(n - 1, n - i) % Mod * fac[n - i] % Mod) % Mod;
  cout << (fac[n] - ans + Mod) % Mod << endl;
  return 0;
}
