#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, M = 1e6 + 50;
int n, k, g[M], a[M], c, ans, t;
int main() {
  cin >> n >> k;
  g[0] = t = 1, ans = n;
  for (int i = 1; i <= n; i++) {
    a[i] = (-1ll * (mod / i) * a[mod % i] % mod + mod + (i == 1)) % mod;
    c = (c + g[i - 1]) % mod;
    if (i > k) c = (c - g[i - k - 1] + mod) % mod;
    g[i] = 1ll * c * a[i] % mod;
    ans = (ans - g[i - 1] + mod) % mod;
    if (i != 1) t = 1ll * t * (i - 1) % mod;
  }
  cout << 1ll * t * ans % mod << endl;
}
