#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int n, k;
int f[N], pre[N], fac[N], inv[N];
template <typename T>
inline void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
inline void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  x *= f;
}
inline int power(int a, int n) {
  int res = 1, b = a;
  while (n > 0) {
    if (n & 1) res = 1LL * res * b % mod;
    b = 1LL * b * b % mod;
    n >>= 1;
  }
  return res;
}
inline int C(int n, int m) {
  if (n < m)
    return 0;
  else
    return 1LL * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline int sub(int x, int y) {
  x -= y;
  if (x < 0) x += mod;
  return x;
}
inline int calc(int l, int r) {
  if (l >= 0)
    return sub(pre[r], pre[l]);
  else
    return pre[r];
}
int main() {
  read(n);
  read(k);
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1LL * fac[i - 1] * i % mod;
  inv[n] = power(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = 1LL * inv[i + 1] * (i + 1) % mod;
  f[0] = pre[0] = 1;
  for (int i = 1; i <= n; ++i) {
    f[i] = 1LL * fac[i - 1] * calc(i - k - 1, i - 1) % mod;
    pre[i] = (pre[i - 1] + 1LL * f[i] * inv[i] % mod) % mod;
  }
  int ans = fac[n];
  for (int i = 1; i <= n; ++i)
    ans = sub(ans, 1LL * f[i - 1] * C(n - 1, n - i) % mod * fac[n - i] % mod);
  printf("%d\n", ans);
  return 0;
}
