#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, mod = 1e9 + 7;
int rev[N], fact = 1;
long long g[N];
int main() {
  int n, k;
  cin >> n >> k;
  rev[1] = 1;
  for (int i = 2; i <= n; ++i)
    rev[i] = 1ll * rev[mod % i] * (mod - mod / i) % mod,
    fact = 1ll * fact * (i - 1) % mod;
  g[0] = 1;
  for (int i = 1; i <= n; ++i) {
    g[i] = g[i - 1];
    if (i > k) g[i] -= g[i - k - 1];
    g[i] = (g[i] * rev[i] % mod + mod) % mod;
    g[i] = (g[i] + g[i - 1]) % mod;
  }
  cout << 1ll * fact * (n - g[n - 1] + mod) % mod << endl;
}
