#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
using ld = long double;
constexpr int nax = 1000 * 1000 + 105;
constexpr int infty = 1000 * 1000 * 1000 + 5;
constexpr int mod = 1000 * 1000 * 1000 + 7;
ll Dodaj(ll a, ll b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
ll Odejmij(ll a, ll b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
ll Mnoz(ll a, ll b) { return (a * b) % mod; }
ll Pot(ll a, int p) {
  ll res = 1;
  while (p) {
    if (p % 2 == 1) res = Mnoz(res, a);
    a = Mnoz(a, a);
    p /= 2;
  }
  return res;
}
ll Odw(ll a) { return Pot(a, mod - 2); }
ll sil[nax];
ll odwsil[nax];
ll odw[nax];
ll Dwumian(int n, int k) {
  if (k > n or k < 0) return 0ll;
  return Mnoz(sil[n], Mnoz(odwsil[n - k], odwsil[k]));
}
int n, k;
ll dp[nax];
void Algos() {
  for (int i = 1; i <= k + 1; i++) {
    dp[i] = 1;
  }
  ll last = k;
  for (int j = k + 2; j <= n; j++) {
    dp[j] = Mnoz(last, odw[j - 1]);
    last = Dodaj(last, dp[j]);
    last = Odejmij(last, dp[j - k]);
  }
  for (int i = 1; i <= n; i++) {
    dp[i] = Mnoz(dp[i], sil[i - 1]);
    debug() << "dp[" << i << "] = " << dp[i] << " | "
            << Mnoz(dp[i], sil[i - 1]);
  }
  ll wynik = 0;
  for (int i = 1; i <= n; i++) {
    wynik = Dodaj(wynik, Mnoz(dp[i], Mnoz(sil[n - i], Dwumian(n - 1, n - i))));
  }
  debug() << " ["
          << "wynik"
             ": "
          << (wynik) << "] ";
  cout << Odejmij(sil[n], wynik) << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  sil[0] = 1;
  for (int i = 1; i <= n; i++) {
    sil[i] = Mnoz(sil[i - 1], i);
  }
  odwsil[n] = Odw(sil[n]);
  for (int i = n - 1; i >= 0; i--) {
    odwsil[i] = Mnoz(odwsil[i + 1], i + 1);
  }
  for (int i = 1; i <= n; i++) {
    odw[i] = Mnoz(odwsil[i], sil[i - 1]);
  }
  Algos();
  return 0;
}
