#include <bits/stdc++.h>
using namespace std;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.first);
  putchar(' ');
  _W(x.second);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
template <class T, class... U>
void DEBUG(const T &head, const U &...tail) {}
int MOD = 1e9 + 7;
void ADD(int64_t &x, int64_t v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
const int SIZE = 1e6 + 10;
int64_t fac[SIZE], inv[SIZE];
int64_t mypow(int64_t x, int64_t y) {
  int64_t res = 1;
  while (y) {
    if (y & 1) res = res * x % MOD;
    y >>= 1;
    x = x * x % MOD;
  }
  return res;
}
int64_t C(int x, int y) {
  if (y < 0 || y > x) return 0;
  return fac[x] * inv[y] % MOD * inv[x - y] % MOD;
}
void build() {
  assert(MOD >= SIZE);
  fac[0] = 1;
  for (int i = (1); i < (SIZE); ++i) fac[i] = fac[i - 1] * i % MOD;
  inv[SIZE - 1] = mypow(fac[SIZE - 1], MOD - 2);
  for (int i = SIZE - 2; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % MOD;
}
int fast_max(int n, int k, vector<int> a) {
  int ans = 0;
  int offset = 0;
  for (int i = 0; i < n; ++i) {
    if (ans < a[i]) {
      ans = a[i];
      offset = 0;
    } else {
      offset = offset + 1;
      if (offset == k) break;
    }
  }
  return ans == n;
}
int solve(int n, int k) {
  vector<int> a;
  for (int i = (1); i <= (n); ++i) a.push_back(i);
  int cnt = 0;
  do {
    if (!fast_max(n, k, a)) cnt++;
  } while (next_permutation((a).begin(), (a).end()));
  return cnt;
}
int64_t dp[SIZE];
int main() {
  build();
  int N, K;
  R(N, K);
  int64_t an = 0;
  dp[0] = 1;
  dp[1] = 1;
  dp[2] = 1;
  int64_t now = 1;
  for (int i = (2); i <= (N); ++i) {
    now = now * (i - 2) % MOD;
    ADD(now, dp[i - 1]);
    if (i - K - 1 >= 1)
      ADD(now, -dp[i - K - 1] * fac[i - 2] % MOD *
                   ((i - K - 2 >= 0) ? inv[i - K - 2] : 1));
    dp[i] = now;
  }
  an = fac[N];
  for (int i = (1); i <= (N); ++i) {
    DEBUG("dp[", i, "]=", dp[i]);
    ADD(an, -dp[i] * C(N - 1, N - i) % MOD * fac[N - i]);
  }
  W(an);
  return 0;
}
