#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000086;
const int MOD = 1e9 + 7;
long long fac[maxn], inv[maxn], ans, f[maxn], sum[maxn];
int n, m, k;
inline long long ksm(long long a, int b) {
  long long ans = 1, tmp = a;
  while (b) {
    if (b & 1) ans = ans * tmp % MOD;
    tmp = tmp * tmp % MOD;
    b >>= 1;
  }
  return ans;
}
inline void _prepare() {
  inv[0] = fac[0] = 1;
  for (register int i = 1; i < maxn; ++i) {
    fac[i] = fac[i - 1] * i % MOD;
  }
  inv[maxn - 1] = ksm(fac[maxn - 1], MOD - 2);
  for (register int i = maxn - 2; i >= 1; --i) {
    inv[i] = inv[i + 1] * (i + 1) % MOD;
  }
}
int main() {
  _prepare();
  scanf("%d%d", &n, &k);
  for (register int i = 2 + k; i <= n; ++i) {
    f[i] = (i - k - 1 + sum[i - 1] - sum[i - k - 1] + MOD) % MOD * fac[i - 2] %
           MOD;
    sum[i] = (sum[i - 1] + f[i] * inv[i - 1] % MOD + MOD) % MOD;
  }
  printf("%I64d", sum[n] * fac[n - 1] % MOD);
  return 0;
}
