#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 1000;
long long sum(long long a, long long b) {
  long long sol = a + b;
  if (sol > mod) sol -= mod;
  return sol;
}
long long sub(long long a, long long b) {
  long long sol = a - b;
  if (sol < 0) sol += mod;
  return sol;
}
long long prod(long long a, long long b) {
  long long sol = a * b;
  if (sol > mod) sol %= mod;
  return sol;
}
long long pown(long long a, long long b) {
  if (b == 0) return 1;
  long long x = pown(a, b / 2);
  x = prod(x, x);
  if (b & 1)
    return prod(a, x);
  else
    return x;
}
long long inv(long long a) { return pown(a, mod - 2); }
long long fact[maxn];
long long invi[maxn];
long long t[maxn], ac[maxn];
long long n, k;
long long bin(long long a, long long b) {
  if (b > a) return 0;
  long long sol = fact[a];
  sol = prod(sol, invi[b]);
  sol = prod(sol, invi[a - b]);
  return sol;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  fact[0] = 1;
  for (long long i = 1; i < n + 2; ++i) fact[i] = prod(fact[i - 1], i);
  for (long long i = 0; i < n + 2; ++i) invi[i] = inv(fact[i]);
  ac[0] = 0;
  for (long long i = 0; i <= n; ++i) {
    if (i <= k)
      t[i] = 0;
    else {
      t[i] = bin(i - 1, i - k - 1);
      long long aux = sub(fact[i - k - 1], ac[i - k]);
      t[i] = prod(t[i], aux);
      t[i] = prod(t[i], fact[k]);
    }
    ac[i + 1] = prod(ac[i], i);
    ac[i + 1] = sum(ac[i + 1], t[i]);
  }
  long long sol = 0;
  for (long long i = 0; i <= n; ++i) {
    sol = sum(sol, prod(fact[n - i], prod(t[i], bin(n - 1, i - 1))));
  }
  sol = sum(sol, sub(fact[n], ac[n + 1]));
  cout << sub(fact[n], sol) << '\n';
}
