#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int mod = 1e9 + 7;
int fac[MAXN], inv[MAXN], ifac[MAXN], f[MAXN], s[MAXN];
int n, k;
inline int choose(int n, int m) {
  return n < m ? 0 : (long long)fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}
int main() {
  scanf("%d%d", &n, &k);
  inv[1] = 1;
  for (int i = 2; i <= n; i++) {
    inv[i] = mod - (long long)mod / i * inv[mod % i] % mod;
    if ((long long)i * inv[i] % mod != 1) throw;
  }
  fac[0] = ifac[0] = 1;
  for (int i = 1; i <= n; i++)
    fac[i] = (long long)fac[i - 1] * i % mod,
    ifac[i] = (long long)ifac[i - 1] * inv[i] % mod;
  f[0] = 1, s[0] = 1;
  for (int i = 1; i <= n; i++) {
    int mul = s[i - 1];
    if (i - k - 1 >= 0) mul -= s[i - k - 1];
    f[i] = ((long long)fac[i - 1] * mul % mod + mod) % mod;
    s[i] = (s[i - 1] + (long long)f[i] * ifac[i] % mod) % mod;
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    ans = (ans +
           (long long)f[i] * choose(n - 1, i) % mod * fac[n - 1 - i] % mod) %
          mod;
  cout << ((fac[n] - ans) % mod + mod) % mod << endl;
  return 0;
}
