#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1 << 20;
const ll M = 1e9 + 7;
ll fp(ll a, ll p) {
  ll first = 1;
  for (; p > 0; p >>= 1) {
    if (p & 1) {
      (first *= a) %= M;
    }
    (a *= a) %= M;
  }
  return first;
}
ll inv(ll a) {
  ll b = fp(a, M - 2);
  assert(a * b % M == 1);
  return b;
}
ll n, k;
ll fa[N];
ll dp[N];
ll pr[N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  fa[0] = 1;
  for (ll i = 1; i < N; ++i) {
    fa[i] = fa[i - 1] * i % M;
  }
  cin >> n >> k;
  for (ll i = k + 1; i <= n; ++i) {
    dp[i] = (i - k - 1);
    (dp[i] += pr[i - 1] - pr[i - k - 1] + M) %= M;
    (dp[i] *= fa[i - 2]) %= M;
    (pr[i] = pr[i - 1] + dp[i] * inv(fa[i - 1])) %= M;
  }
  ll answer = 0;
  for (ll i = 1; i <= n; ++i) {
    ll cur = dp[i] * fa[n - 1] % M;
    (cur *= inv(fa[i - 1])) %= M;
    (answer += cur) %= M;
  }
  cout << answer << "\n";
  return 0;
}
