#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
int fpow(int a, int b) {
  int ans = 1, t = a;
  while (b) {
    if (b & 1) ans = 1ll * ans * t % Mod;
    t = 1ll * t * t % Mod;
    b >>= 1;
  }
  return ans;
}
int fac[1000010], inv[1000010];
int Inv[1000010];
int f[1000010], F[1000010];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if (k >= n) {
    printf("0\n");
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % Mod;
  inv[n] = fpow(fac[n], Mod - 2);
  for (int i = n; i >= 1; i--) {
    inv[i - 1] = 1ll * inv[i] * i % Mod;
    Inv[i] = 1ll * inv[i] * fac[i - 1] % Mod;
  }
  f[0] = 1;
  F[0] = 1;
  for (int i = 1; i < n; i++) {
    int sum = F[i - 1];
    if (i - k > 0) sum = (sum - F[i - k - 1] + Mod) % Mod;
    f[i] = 1ll * sum * Inv[i] % Mod;
    F[i] = (F[i - 1] + f[i]) % Mod;
  }
  int ans = (fac[n] - 1ll * F[n - 1] * fac[n - 1] % Mod + Mod) % Mod;
  printf("%d\n", ans);
  return 0;
}
