#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Read(T &n) {
  char ch;
  bool flag = false;
  while (!isdigit(ch = getchar())) {
    if (ch == '-') flag = true;
  }
  for (n = ch ^ 48; isdigit(ch = getchar());
       n = (n << 1) + (n << 3) + (ch ^ 48))
    ;
  if (flag) n = -n;
}
enum { MAXN = 1000005, MOD = 1000000007 };
inline int dec(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
inline void ddec(int &a, int b) { a = dec(a, b); }
int n, k;
int f[MAXN], sum, inv[MAXN], jc[MAXN], ans;
inline int C(int n, int m) {
  return 1ll * jc[n] * inv[m] % MOD * inv[n - m] % MOD;
}
int main() {
  Read(n);
  Read(k);
  inv[1] = 1;
  for (register int i = 2; i <= n; i++)
    inv[i] = 1ll * (MOD - MOD / i) * inv[MOD % i] % MOD;
  inv[0] = 1;
  for (register int i = 2; i <= n; i++)
    inv[i] = 1ll * inv[i] * inv[i - 1] % MOD;
  jc[0] = 1;
  for (register int i = 1; i <= n; i++) jc[i] = 1ll * jc[i - 1] * i % MOD;
  sum = 1;
  f[0] = 1;
  for (register int i = 1; i <= n; i++) {
    f[i] = 1ll * sum * jc[i - 1] % MOD;
    if (i - k >= 0) ddec(sum, 1ll * f[i - k] * inv[i - k] % MOD);
    sum = (sum + 1ll * f[i] * inv[i]) % MOD;
    ans = (ans + 1ll * f[i - 1] * C(n - 1, n - i) % MOD * jc[n - i]) % MOD;
  }
  cout << dec(jc[n], ans) << endl;
  return 0;
}
