#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 50;
const long long P = 1e9 + 7;
long long ans, n, k, fac[N], fac_inv[N], inv[N], f[N], sum[N];
int main() {
  cin >> n >> k;
  inv[1] = 1;
  for (int i = 2; i <= (n); ++i) inv[i] = inv[P % i] * (P - P / i) % P;
  fac[0] = 1;
  for (int i = 1; i <= (n); ++i) fac[i] = fac[i - 1] * i % P;
  fac_inv[0] = 1;
  for (int i = 1; i <= (n); ++i) fac_inv[i] = fac_inv[i - 1] * inv[i] % P;
  for (int i = k + 1; i <= (n); ++i) {
    f[i] = (i - 1 - k) + (sum[i - 1] - sum[i - k - 1]);
    f[i] = (f[i] % P + P) % P;
    f[i] = f[i] * fac[i - 2] % P;
    sum[i] = (sum[i - 1] + f[i] * fac_inv[i - 1] % P) % P;
  }
  for (int i = 1; i <= (n); ++i)
    ans = (ans + f[i] * fac[n - 1] % P * fac_inv[i - 1] % P) % P;
  cout << ans << endl;
  return 0;
}
