#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, k, f[N], s[N], ans = 0, fac[N], inv[N], ifac[N];
void init() {
  const int n = 1e6;
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  ifac[0] = 1;
  for (int i = 1; i <= n; i++) ifac[i] = 1ll * ifac[i - 1] * inv[i] % mod;
}
int C(int n, int m) {
  if (m < 0 || n < m) return 0;
  return 1ll * fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
int main() {
  cin >> n >> k;
  init();
  f[0] = s[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = 1ll * (s[i - 1] - (i - k - 1 >= 0 ? s[i - k - 1] : 0)) * fac[i - 1] %
           mod;
    s[i] = (s[i - 1] + 1ll * f[i] * ifac[i] % mod) % mod;
  }
  for (int i = 1; i <= n; i++)
    ans =
        (ans + 1ll * C(n - 1, i - 1) * f[i - 1] % mod * fac[n - i] % mod) % mod;
  ans = fac[n] - ans;
  cout << (ans % mod + mod) % mod;
  return 0;
}
