#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int mod = 1e9 + 7;
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
struct Mint {
  int a;
  Mint(int _a = 0) : a(_a) {}
  friend ostream &operator<<(ostream &out, const Mint &_) {
    out << _.a;
    return out;
  }
  bool operator==(const Mint &_) const { return a == _.a; }
  bool operator!() const { return !a; }
  Mint operator+(const Mint &_) const {
    int ret = a + _.a;
    return ret < mod ? Mint(ret) : Mint(ret - mod);
  }
  Mint operator-(const Mint &_) const { return *this + Mint(mod - _.a); }
  Mint operator*(const Mint &_) const { return Mint((int)((LL)a * _.a % mod)); }
  friend Mint &operator+=(Mint &a, const Mint &b) { return a = a + b; }
  friend Mint &operator-=(Mint &a, const Mint &b) { return a = a - b; }
  friend Mint &operator*=(Mint &a, const Mint &b) { return a = a * b; }
  Mint &operator++() { return *this = *this + Mint(1); }
  Mint &operator--() { return *this = *this - Mint(1); }
  template <class T>
  Mint binPow(T exp) const {
    Mint ret(1), c = *this;
    for (; exp; exp >>= 1, c *= c)
      if (exp & 1) ret *= c;
    return ret;
  }
};
vector<Mint> fact, invFact;
Mint C(int n, int k) {
  return n < 0 || k < 0 || k > n ? Mint(0)
                                 : fact[n] * invFact[k] * invFact[n - k];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  fact.assign(n + 1, Mint());
  fact[0] = Mint(1);
  for (int i = 1; i < ((int)(fact).size()); ++i)
    fact[i] = fact[i - 1] * Mint(i);
  invFact.assign(((int)(fact).size()), Mint());
  invFact.back() = fact.back().binPow<int>(mod - 2);
  for (int i = ((int)(invFact).size()) - 2; ~i; --i)
    invFact[i] = invFact[i + 1] * Mint(i + 1);
  vector<Mint> f(n + 1), g(n + 2);
  f[0] = Mint(1), g[1] = f[0];
  for (int i = 1; i < ((int)(f).size()); ++i) {
    f[i] = fact[i - 1] * (g[i] - g[max(0, i - k)]);
    g[i + 1] = g[i] + f[i] * invFact[i];
  }
  Mint ans;
  for (int i = 0; i < n; ++i)
    ans += (fact[i] - f[i]) * C(n - 1, i) * fact[n - i - 1];
  cout << ans << '\n';
  return 0;
}
