#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char now[1 << 16], *S, *T;
  if (T == S) {
    T = (S = now) + fread(now, 1, 1 << 16, stdin);
    if (T == S) return EOF;
  }
  return *S++;
}
inline long long read() {
  register long long x = 0, f = 1;
  char ch = gc();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = gc();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = gc();
  }
  return (f == 1) ? x : -x;
}
long long n, inv[1010101], fac[1010101], K;
long long f[1010101], sumf[1010101];
inline long long C(long long n, long long m) {
  if (n < 0 || m < 0) return 0;
  if (m > n) return 0;
  return fac[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
signed main() {
  n = read(), K = read();
  inv[0] = inv[1] = fac[1] = fac[0] = 1;
  for (long long i = 2; i <= n + 2; i++) fac[i] = fac[i - 1] * i % 1000000007;
  for (long long i = 2; i <= n + 2; i++)
    inv[i] =
        (1000000007 - (1000000007 / i) * inv[1000000007 % i] % 1000000007) %
        1000000007;
  for (long long i = 2; i <= n + 2; i++)
    inv[i] = inv[i - 1] * inv[i] % 1000000007;
  f[0] = sumf[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = fac[i - 1] *
           (sumf[i - 1] -
            (max(-1ll, i - K - 1) == -1 ? 0 : sumf[max(-1ll, i - K - 1)]) +
            1000000007) %
           1000000007;
    sumf[i] = (sumf[i - 1] + f[i] * inv[i] % 1000000007) % 1000000007;
  }
  long long ans = fac[n];
  for (int i = 1; i <= n; i++) {
    ans = (ans -
           fac[n - i] * f[i - 1] % 1000000007 * C(n - 1, i - 1) % 1000000007 +
           1000000007) %
          1000000007;
  }
  cout << ans;
  return 0;
}
