#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long ex(long long b, long long st) {
  long long ans = 1;
  long long now = b;
  for (long long i = 0; i < 40; i++) {
    long long ba = (1LL << i) & st;
    if (ba == 0) {
      now *= now;
      now %= MOD;
      continue;
    }
    ans *= now;
    ans %= MOD;
    now *= now;
    now %= MOD;
  }
  return ans;
}
long long res(long long a, long long b) { return (ex(b, MOD - 2) * a) % MOD; }
signed main() {
  ios_base::sync_with_stdio(false);
  long long n, k;
  cin >> n >> k;
  if (n + 1 <= k) {
    cout << 0 << endl;
    return 0;
  }
  long long L = 0;
  vector<long long> fact;
  fact.push_back(1);
  for (long long i = 1; i < 2e6; i++) {
    fact.push_back((fact[i - 1] * i) % MOD);
  }
  long long old = 0;
  vector<long long> f(n + 1), s(n + 1);
  for (long long i = 0; i <= k + 1; i++) {
    f[i] = 0;
    s[i] = 0;
  }
  for (long long i = k + 2; i <= n; i++) {
    long long N = L * (i - 1);
    N += L;
    N += fact[i - 2] * (i - k - 1);
    old *= (i - 2);
    long long YY = (f[i - k - 2] + s[i - k - 2]);
    YY *= fact[i - 2];
    YY %= MOD;
    YY = res(YY, fact[i - k - 2]);
    old += YY;
    old %= MOD;
    s[i - 1] = ((fact[i - 2] * (i - k - 1) - old) % MOD + MOD) % MOD;
    N -= (old);
    L = (N % MOD + MOD) % MOD;
    f[i] = L % MOD;
  }
  cout << L << endl;
  return 0;
}
