#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char ch;
  bool neg = 0;
  while (!isdigit(ch = getchar()) && ch != '-')
    ;
  if (ch == '-') {
    neg = 1;
    ch = getchar();
  }
  do {
    x = 10 * x + ch - '0';
  } while (isdigit(ch = getchar()));
  if (neg) x = -x;
}
const int N = 1e6 + 111;
const long long MOD = 1e9 + 7;
int n, k;
long long Fac[N], InvF[N], dp[N], Sum[N], res;
long long power(long long a, int x) {
  if (x == 1) return a;
  long long tmp = power(a, x >> 1);
  tmp = (tmp * tmp) % MOD;
  if (x % 2) tmp = (tmp * a) % MOD;
  return tmp;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  read(n);
  read(k);
  Fac[0] = 1;
  for (int i = 1; i <= n; i++) Fac[i] = (Fac[i - 1] * (long long)i) % MOD;
  InvF[0] = 1;
  for (int i = 1; i <= n; i++) InvF[i] = power(Fac[i], MOD - 2);
  for (int i = k + 1; i <= n; i++) {
    dp[i] =
        (long long)(Fac[i - 2] * (i - k - 1 + Sum[i - 1] - Sum[i - k - 1])) %
        MOD;
    if (dp[i] < 0) dp[i] += MOD;
    Sum[i] = (Sum[i - 1] + dp[i] * InvF[i - 1]) % MOD;
  }
  for (int i = k + 1; i <= n; i++) {
    res = (res + dp[i] * (Fac[n - 1] * InvF[i - 1] % MOD)) % MOD;
  }
  cout << res << '\n';
  return 0;
}
