#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
template <typename T>
bool cmax(T &a, T b) {
  return (a < b) ? a = b, 1 : 0;
}
template <typename T>
bool cmin(T &a, T b) {
  return (a > b) ? a = b, 1 : 0;
}
template <typename T>
T read() {
  T ans = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (isdigit(ch))
    ans = (ans << 3) + (ans << 1) + (ch - '0'), ch = getchar();
  return ans * f;
}
template <typename T>
void write(T x, char y) {
  if (x == 0) {
    putchar('0'), putchar(y);
    return;
  }
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  static char wr[20];
  int top = 0;
  for (; x; x /= 10) wr[++top] = x % 10 + '0';
  while (top) putchar(wr[top--]);
  putchar(y);
}
void file() {}
int n, k;
void input() { n = read<int>(), k = read<int>(); }
const int mo = 1e9 + 7;
int dp[N], sum[N];
int Mod(int x, int y) { return x + y >= mo ? x + y - mo : x + y; }
long long power(long long x, int y) {
  long long res = 1;
  for (; y; x = x * x % mo, y >>= 1)
    if (y & 1) res = res * x % mo;
  return res;
}
int mc[N], inv[N];
void work() {
  mc[0] = inv[0] = 1;
  for (register int i = (int)1; i <= (int)n; ++i)
    mc[i] = 1ll * mc[i - 1] * i % mo;
  inv[n] = power(mc[n], mo - 2);
  for (register int i = (int)n - 1; i >= (int)1; --i)
    inv[i] = 1ll * inv[i + 1] * (i + 1) % mo;
  for (register int i = (int)k + 2; i <= (int)n; ++i) {
    dp[i] = Mod(1ll * (i - k - 1) * mc[i - 2] % mo,
                1ll * (sum[i - 1] - sum[i - k - 1] + mo) % mo * mc[i - 2] % mo);
    sum[i] = Mod(sum[i - 1], 1ll * dp[i] * inv[i - 1] % mo);
  }
  int ans = 0;
  for (register int i = (int)1; i <= (int)n; ++i)
    ans = Mod(ans, 1ll * dp[i] * mc[n - 1] % mo * inv[i - 1] % mo);
  write(ans, '\n');
}
int main() {
  file();
  input();
  work();
  return 0;
}
