#include <bits/stdc++.h>
using namespace std;
int n, k;
long long ni[1000010], dp[1000010], jie[1000010], ans, s[1000010];
const long long mod = 1e9 + 7;
inline long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &k);
  if (n <= k + 1) {
    printf("0\n");
    return 0;
  }
  jie[0] = 1;
  for (int i = 1; i <= n; ++i) jie[i] = jie[i - 1] * i % mod;
  ni[n] = ksm(jie[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) ni[i] = ni[i + 1] * (i + 1) % mod;
  dp[0] = 1;
  s[0] = 1;
  for (int i = 1; i <= n; ++i) {
    if (i - k - 1 >= 0)
      dp[i] = jie[i - 1] * (s[i - 1] - s[i - k - 1] + mod) % mod;
    else
      dp[i] = jie[i - 1] * s[i - 1] % mod;
    s[i] = (s[i - 1] + dp[i] * ni[i] % mod) % mod;
  }
  ans = jie[n];
  for (int i = 1; i <= n; ++i)
    ans = (ans - dp[i - 1] * jie[n - 1] % mod * ni[i - 1] % mod + mod) % mod;
  printf("%lld\n", ans);
  return 0;
}
