#include <bits/stdc++.h>
using namespace std;
int n, k;
int fac[1000005], inv[1000005], Inv[1000005], dp[1000005], sum[1000005];
const int mod = 1e9 + 7;
int qkpow(int a, int b) {
  int ans = 1, base = a;
  while (b) {
    if (b & 1) ans = 1ll * ans * base % mod;
    base = 1ll * base * base % mod;
    b >>= 1;
  }
  return ans;
}
int C(int n, int m) { return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod; }
signed main() {
  scanf("%d %d", &n, &k);
  fac[0] = inv[0] = Inv[1] = 1;
  for (int i = 1; i <= 1000000; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  for (int i = 2; i <= 1000000; i++)
    Inv[i] = 1ll * (mod - mod / i) * Inv[mod % i] % mod;
  dp[0] = sum[0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i] = 1ll * (sum[i - 1] - ((i - k - 1) < 0 ? 0 : sum[i - k - 1])) % mod *
            Inv[i] % mod;
    sum[i] = (sum[i - 1] + dp[i]) % mod;
  }
  printf("%d\n", (1ll * fac[n - 1] * (n - sum[n - 1]) % mod + mod) % mod);
  return 0;
}
