#include <bits/stdc++.h>
const int N = 1e6 + 5, mo = 1e9 + 7;
using namespace std;
int n, k, f[N], g[N], inv[N], fac[N];
inline int mul(int a, int b) {
  int ans = 1, w = a % mo;
  for (; b; b /= 2) {
    if (b & 1) ans = (long long)ans * w % mo;
    w = (long long)w * w % mo;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = (long long)fac[i - 1] * i % mo;
  inv[n] = mul(fac[n], mo - 2);
  for (int i = n - 1; i >= 0; --i)
    inv[i] = (long long)inv[i + 1] * (i + 1) % mo;
  f[0] = g[0] = 1;
  for (int i = 1; i <= n; ++i) {
    f[i] = fac[i - 1];
    if (i - k - 1 < 0)
      f[i] = (long long)f[i] * g[i - 1] % mo;
    else
      f[i] = (long long)f[i] * (g[i - 1] - g[i - k - 1]) % mo;
    g[i] = g[i - 1] + (long long)f[i] * inv[i] % mo;
    g[i] %= mo;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    ans += (long long)f[i - 1] * inv[i - 1] % mo;
    ans %= mo;
  }
  ans = (long long)ans * fac[n - 1] % mo;
  ans = fac[n] - ans;
  ans %= mo;
  printf("%d\n", (ans + mo) % mo);
  return 0;
}
