#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vii = vector<ii>;
const ll MOD = 1000000007;
long long pow(long long base, long long power, long long mod) {
  long long result = 1;
  while (power) {
    if (power & 1) result = result * base % mod;
    base = base * base % mod;
    power >>= 1;
  }
  return result;
}
long long inverse(long long a, long long mod) { return pow(a, mod - 2, mod); }
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vll fact(n);
  fact[0] = 1;
  for (int i = (1), _i = (n); i < _i; ++i) fact[i] = i * fact[i - 1] % MOD;
  vll dp(n + 1, 0);
  for (int i = (k + 2), _i = (n + 1); i < _i; ++i)
    dp[i] =
        (dp[i - 1] + ((i - k - 1) + dp[i - 1] - dp[i - k - 1] + MOD) *
                         fact[i - 2] % MOD * inverse(fact[i - 1], MOD) % MOD) %
        MOD;
  cout << dp[n] * fact[n - 1] % MOD << endl;
}
