#include <bits/stdc++.h>
const long long _ = 1e6 + 5, mod = 1e9 + 7;
using namespace std;
long long n, k, g[_], inv[_], Sum, ans, fac;
signed main() {
  cin >> n >> k;
  g[0] = fac = 1;
  ans = n;
  for (long long i = 1; i <= n; i++) {
    inv[i] = (-1 * (mod / i) * inv[mod % i] % mod + mod + (i == 1)) % mod;
    Sum = (Sum + g[i - 1]) % mod;
    if (i > k) Sum = (Sum - g[i - k - 1] + mod) % mod;
    g[i] = Sum * inv[i] % mod;
    ans = (ans - g[i - 1] + mod) % mod;
    if (i != 1) fac = fac * (i - 1) % mod;
  }
  cout << fac * ans % mod << endl;
}
