#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2000010;
int cj[N], inv[N];
int dp[N], sum[N];
int ans;
int n, k;
int power(int x, int y) {
  int ret = 1;
  for (; y; y >>= 1, x = 1ll * x * x % mod) {
    if (y & 1) ret = 1ll * ret * x % mod;
  }
  return ret;
}
int main() {
  int i;
  scanf("%d%d", &n, &k);
  cj[0] = 1;
  for (i = 1; i <= n; i++) cj[i] = 1ll * cj[i - 1] * i % mod;
  inv[n] = power(cj[n], mod - 2);
  inv[0] = 1;
  for (i = n - 1; i; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
  dp[0] = 1;
  for (i = 1; i <= k; i++) {
    dp[i] = cj[i];
    sum[i] = (sum[i - 1] + 1ll * dp[i] * inv[i]) % mod;
  }
  for (i = k + 1; i <= n; i++) {
    dp[i] = 1ll * cj[i - 1] * (sum[i - 1] - sum[i - k - 1] + mod) % mod;
    sum[i] = (sum[i - 1] + 1ll * dp[i] * inv[i]) % mod;
  }
  for (i = 0; i <= n - 1; i++) {
    ans = (ans + 1ll * dp[n - 1 - i] * cj[n - 1] % mod * inv[n - 1 - i]) % mod;
  }
  ans = (cj[n] - ans + mod) % mod;
  printf("%d", ans);
  return 0;
}
