#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
const long long M = 1000000007;
struct BIT {
  long long a[N];
  void add(int p, long long x) {
    for (p++; p < N; p += p & (-p)) a[p] = (a[p] + x) % M;
  }
  long long sum(int p) {
    long long ans = 0;
    for (p++; p > 0; p -= p & (-p)) ans += a[p];
    return ans % M;
  }
  long long sum(int l, int r) { return (sum(r) - sum(l - 1) + M) % M; }
} bit;
long long f[N];
long long pmd(long long x, int p) {
  long long ans = 1;
  for (; p > 0; p >>= 1, x = (x * x) % M)
    if (p & 1) ans = (ans * x) % M;
  return ans;
}
long long inv(long long x) { return pmd(x, M - 2); }
long long C(int a, int b) { return f[a] * inv(f[b]) % M * inv(f[a - b]) % M; }
long long dp[N];
long long p[N];
int main() {
  f[0] = 1;
  for (int i = 1; i < N; i++) f[i] = (f[i - 1] * i) % M;
  int n, k;
  scanf("%d %d", &n, &k);
  dp[0] = 1;
  p[0] = 0;
  for (int i = 1; i < n; i++) {
    p[i] = (p[i - 1] + dp[i - 1]) % M;
    dp[i] = (p[i] - p[max(i - k, 0)] + M) % M * inv(i) % M;
  }
  p[n] = (p[n - 1] + dp[n - 1]) % M;
  long long ans = f[n];
  for (int i = 0; i < n; i++)
    ans = (ans -
           (p[i + 1] - p[i]) * f[i] % M * C(n - 1, i) % M * f[n - i - 1] % M +
           M) %
          M;
  printf("%lld\n", ans);
  return 0;
}
