#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
int n, k;
int fac[N], ifac[N];
int qpow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
int dp[N], sum[N];
int main() {
  scanf("%d%d", &n, &k);
  k++;
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  ifac[n] = qpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) ifac[i] = 1ll * ifac[i + 1] * (i + 1) % mod;
  dp[0] = 1;
  sum[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (i - k >= 0)
      dp[i] = (sum[i - 1] - sum[i - k] + mod) % mod;
    else
      dp[i] = sum[i - 1];
    dp[i] = 1ll * dp[i] * fac[i - 1] % mod;
    sum[i] = (sum[i - 1] + 1ll * dp[i] * ifac[i] % mod) % mod;
  }
  int ans = fac[n];
  for (int i = 1; i <= n; i++) {
    int res = dp[i - 1];
    res = 1ll * res * fac[n - 1] % mod * ifac[i - 1] % mod;
    ans = (ans - res + mod) % mod;
  }
  printf("%d\n", ans);
  return 0;
}
