#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
inline void read(int &X) {
  X = 0;
  int w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = ((X << 3) + (X << 1) + (ch ^ 48)), ch = getchar();
  if (w) X = -X;
}
void print(int x) {
  if (!x) return;
  if (x < 0) putchar('-'), x = -x;
  print(x / 10);
  putchar(x % 10 + '0');
}
int n, k, jc[1000010], g[1000010], inv[1000010], sum[1000010];
int main() {
  read(n);
  read(k);
  jc[0] = g[0] = sum[0] = 1;
  for (int i = 1; i < n; i++) jc[i] = (1ll * jc[i - 1] * i) % mod;
  inv[1] = 1;
  for (long long i = 2; i <= n; ++i)
    inv[i] = (long long)(mod - mod / i) * inv[mod % i] % mod;
  for (int i = 1; i <= n; i++) {
    if (i <= k)
      g[i] = 1ll * sum[i - 1] * inv[i] % mod;
    else
      g[i] = 1ll * (sum[i - 1] - sum[i - k - 1]) % mod * inv[i] % mod;
    sum[i] = (1ll * sum[i - 1] + g[i]) % mod;
  }
  long long ans = (1ll * jc[n - 1] * (1ll * n - sum[n - 1]) % mod + mod) % mod;
  if (ans)
    print(ans);
  else
    putchar('0');
  return 0;
}
