#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
const int N = 1e6 + 10;
int Pow(int a, int b) {
  if (b == 0) return 1;
  int ret = Pow(a, b >> 1);
  ret = 1ll * ret * ret % P;
  if (b & 1) ret = 1ll * ret * a % P;
  return ret;
}
int fac[N], inv[N], sum[N];
inline int com(int n, int m) {
  if (m > n) return 0;
  return 1ll * fac[n] * inv[m] % P * inv[n - m] % P;
}
int n, k, f[N];
int main() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % P;
  inv[N - 1] = Pow(fac[N - 1], P - 2);
  for (int i = N - 2; i >= 0; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % P;
  scanf("%d%d", &n, &k);
  f[0] = sum[0] = 1;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    f[i] = 1ll * (sum[i - 1] - (i - k - 1 >= 0 ? sum[i - k - 1] : 0)) *
           fac[i - 1] % P;
    sum[i] = (sum[i - 1] + 1ll * f[i] * inv[i]) % P;
  }
  for (int i = 1; i <= n; i++) {
    ans = (ans + 1ll * f[i - 1] * fac[n - i] % P * com(n - 1, i - 1)) % P;
  }
  ans = ((fac[n] - ans) % P + P) % P;
  printf("%d\n", ans);
  return 0;
}
