#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const long long mod = 1e9 + 7;
const int maxn = 1000010;
int n, k;
long long ans, fac[maxn], inv[maxn], f[maxn], sum[maxn];
inline long long pw(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  read(n);
  read(k);
  if (n <= k + 1) {
    puts("0");
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % mod;
  inv[n] = pw(fac[n], mod - 2);
  for (int i = n - 1; ~i; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
  for (int i = k + 2; i <= n; i++) {
    f[i] = (((i - k - 1 + sum[i - 1] - sum[i - k - 1]) % mod + mod) % mod *
            fac[i - 2]) %
           mod;
    sum[i] = (sum[i - 1] + f[i] * inv[i - 1] % mod) % mod;
    (ans += f[i] * fac[n - 1] % mod * inv[i - 1] % mod) %= mod;
  }
  writeln(ans);
  return 0;
}
