#include <bits/stdc++.h>
using namespace std;
int N, K;
int DP[1000005];
const int MOD = 1000000007;
int Partial[1000005], Fact[1000005], Inv[1000005];
void Read() { cin >> N >> K; }
int powerLog(int n, int p) {
  int sol = 1;
  while (p) {
    if (p % 2 == 1) sol = (1LL * sol * n) % MOD;
    p /= 2;
    n = (1LL * n * n) % MOD;
  }
  return sol;
}
inline void Add(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void precalcDP() {
  for (int i = K + 1; i <= N; i++) {
    DP[i] = (1LL * Fact[i - 1] * (i - K)) % MOD;
    int diff = Partial[i - 1] - Partial[i - K - 1];
    if (diff < 0) diff += MOD;
    Add(DP[i], (1LL * diff * Fact[i - 1]) % MOD);
    int add = (1LL * DP[i] * Inv[i]) % MOD;
    Partial[i] = Partial[i - 1];
    Add(Partial[i], add);
  }
}
int main() {
  Read();
  Fact[0] = 1;
  for (int i = 1; i <= N; i++) Fact[i] = (1LL * Fact[i - 1] * i) % MOD;
  Inv[N] = powerLog(Fact[N], MOD - 2);
  for (int i = N - 1; i >= 0; i--) {
    Inv[i] = (1LL * Inv[i + 1] * (i + 1)) % MOD;
  }
  precalcDP();
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int add = (1LL * DP[i] * Fact[N - 1]) % MOD;
    add = (1LL * add * Inv[i]) % MOD;
    Add(ans, add);
  }
  cout << (ans) << '\n';
  return 0;
}
