#include <bits/stdc++.h>
const double Pi = acos(-1.0);
using namespace std;
const int maxN = 1000005;
const long long mod = 1000000007;
int n, k;
long long fact[maxN];
long long dp[maxN], sum[maxN];
long long exp(long long x, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    p >>= 1;
  }
  return res;
}
int main(int argc, char** argv) {
  scanf("%d %d", &n, &k);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = (fact[i - 1] * i) % mod;
  for (int i = k + 2; i <= n; i++) {
    dp[i] = ((i - k - 1) + (sum[i - 1] - sum[i - k - 1]) + mod) % mod;
    dp[i] = (dp[i] * fact[i - 2]) % mod;
    sum[i] = (sum[i - 1] + (dp[i] * exp(fact[i - 1], mod - 2)) % mod) % mod;
  }
  printf("%lld\n", (sum[n] * fact[n - 1]) % mod);
  return 0;
}
