#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
inline int dec(int a, int b) {
  if ((a -= b) < 0) a += mod;
  return a;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int power(int a, int b) {
  int out = 1;
  while (b) {
    if (b & 1) out = mult(out, a);
    a = mult(a, a);
    b >>= 1;
  }
  return out;
}
int n, K, fac[1000010], ifac[1000010], f[1000010], sf[1000010];
int main() {
  scanf("%d%d", &n, &K);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = mult(fac[i - 1], i);
  ifac[n] = power(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; i--) ifac[i] = mult(ifac[i + 1], i + 1);
  f[0] = sf[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = mult(fac[i - 1], dec(sf[i - 1], i - K - 1 >= 0 ? sf[i - K - 1] : 0));
    sf[i] = add(sf[i - 1], mult(f[i], ifac[i]));
  }
  int ans = fac[n];
  for (int i = 0; i < n; i++)
    ans = dec(ans, mult(fac[n - 1], mult(f[i], ifac[i])));
  printf("%d\n", ans);
  return 0;
}
