#include <bits/stdc++.h>
using namespace std;
struct FastIO {
  inline FastIO& operator>>(int& x) {
    x = 0;
    char f = 0, ch = getchar();
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    return x = (f ? -x : x), *this;
  }
  inline FastIO& operator>>(long long& x) {
    x = 0;
    char f = 0, ch = getchar();
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    return x = (f ? -x : x), *this;
  }
  inline FastIO& operator>>(double& x) {
    x = 0;
    char f = 0, ch = getchar();
    double d = 0.1;
    while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
    while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
    if (ch == '.') {
      ch = getchar();
      while (ch <= '9' && ch >= '0')
        x += d * (ch ^ 48), d *= 0.1, ch = getchar();
    }
    return x = (f ? -x : x), *this;
  }
} rin;
const int N = 1e6 + 50;
const int mod = 1e9 + 7;
long long f[N], Sum[N], jc[N], inv[N];
long long ksm(long long x, long long p) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % mod;
    x = x * x % mod;
    p >>= 1;
  }
  return ans;
}
int main() {
  int n, k;
  rin >> n >> k;
  f[0] = 1, jc[0] = 1;
  long long* sum = Sum + 1;
  sum[0] = 1;
  for (int i = 1; i <= n; ++i) jc[i] = jc[i - 1] * i % mod;
  inv[n] = ksm(jc[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
  for (int i = 1; i <= n; ++i) {
    int e = max(-1, i - k - 1);
    f[i] = jc[i - 1] * (sum[i - 1] - sum[e] + mod) % mod;
    sum[i] = sum[i - 1] + f[i] * inv[i] % mod;
    if (sum[i] >= mod) sum[i] -= mod;
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += f[i - 1] * jc[n - 1] % mod * inv[i - 1] % mod;
    if (ans >= mod) ans -= mod;
  }
  printf(
      "%lld"
      "\n",
      (jc[n] - ans + mod) % mod);
  return 0;
}
