#include <bits/stdc++.h>
using namespace std;
const long double pi = acosl(-1);
const int maxn = 1000010;
const long long mod = 1e9 + 7;
const int inf = 1e9;
int n, k;
long long fac[maxn], inv[maxn], f[maxn], g[maxn];
long long pwr(long long a, long long p) {
  if (p == 0) return 1;
  return p & 1 ? a * pwr(a * a % mod, p / 2) % mod : pwr(a * a % mod, p / 2);
}
long long cb(long long n, long long k) {
  return fac[n] * inv[k] % mod * inv[n - k] % mod;
}
int main() {
  scanf("%d%d", &n, &k);
  fac[0] = inv[0] = 1;
  for (int i = 1; i < maxn; i++) fac[i] = fac[i - 1] * i % mod;
  inv[n] = pwr(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
  for (int i = k + 1; i < n + 1; i++) {
    f[i] = (i - k) * fac[i - 1] % mod +
           (g[i - 1] - g[i - k - 1]) % mod * fac[i - 1] % mod;
    g[i] = (g[i - 1] + f[i] * inv[i]) % mod;
  }
  long long ans = 0;
  for (int i = 1; i < n + 1; i++) {
    ans += cb(n - 1, i - 1) * f[i - 1] % mod * fac[n - i] % mod;
  }
  cout << (ans % mod + mod) % mod << endl;
  return 0;
}
