#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n, k;
long long sum[2000000], f[2000000], fac[2000000], inv[2000000], ans;
long long kp(long long a, long long b) {
  if (!b) return 1;
  long long c = kp(a, b >> 1);
  c = c * c % mod;
  if (b & 1) c = c * a % mod;
  return c;
}
int main() {
  scanf("%d%d", &n, &k);
  sum[0] = f[0] = fac[0] = inv[0] = 1;
  for (long long i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % mod;
  for (long long i = n, invv = kp(fac[n], mod - 2); i; i--) {
    inv[i] = invv * fac[i - 1] % mod;
    invv = invv * i % mod;
  }
  for (int i = 1; i < n; i++) {
    if (i > k)
      f[i] = (sum[i - 1] - sum[i - k - 1] + mod) * inv[i] % mod;
    else
      f[i] = sum[i - 1] * inv[i] % mod;
    sum[i] = (sum[i - 1] + f[i]) % mod;
  }
  ans = fac[n - 1] * (n - sum[n - 1] + mod) % mod;
  printf("%lld", ans);
}
