#include <bits/stdc++.h>
using namespace std;
long long f[1000001], g[1000001], i, k, n, gt[1000001], t;
const long long mod = round(1e9) + 7;
long long lt(long long a, long long b) {
  if (b == 0) return 1;
  long long tg = lt(a, b / 2);
  if (b % 2 == 0) return tg * tg % mod;
  return tg * tg % mod * a % mod;
}
int main() {
  cin >> n >> k;
  gt[0] = 1;
  for (i = 1; i <= n; i++) gt[i] = gt[i - 1] * i % mod;
  f[1] = f[0] = 1;
  g[1] = f[1] * lt(gt[0], mod - 2) % mod;
  for (i = 2; i <= n; i++) {
    f[i] = g[i - 1];
    if (i - k - 1 >= 0) f[i] = (f[i] - g[i - k - 1] + mod) % mod;
    f[i] = f[i] * gt[i - 2] % mod;
    g[i] = (g[i - 1] + f[i] * lt(gt[i - 1], mod - 2) % mod) % mod;
  }
  for (i = 1; i <= n; i++)
    t = (t + f[i] * gt[n - 1] % mod * lt(gt[i - 1], mod - 2) % mod) % mod;
  cout << (gt[n] - t + mod) % mod;
}
