#include <bits/stdc++.h>
int d_, x_, y_;
void gcd(int a, int b) {
  if (b == 0)
    d_ = a, x_ = 1, y_ = 0;
  else {
    int t;
    gcd(b, a % b);
    t = x_ - a / b * y_, x_ = y_, y_ = t;
  }
}
int inv(int a) {
  gcd(a, 1000000007);
  return x_;
}
int main() {
  static int dp[1000000];
  int n, k, h;
  long long x, ans, f;
  scanf("%d%d", &n, &k);
  if (k > n - 1) k = n - 1;
  f = 1;
  for (h = 0; h <= k; h++) {
    dp[h] = 1;
    f = f * (h + 1) % 1000000007;
  }
  x = k, ans = k + 1;
  for (h = k + 1; h < n; h++) {
    dp[h] = x * inv(h) % 1000000007;
    x = (x + dp[h] - dp[h - k]) % 1000000007;
    ans = (ans + dp[h]) % 1000000007;
    f = f * (h + 1) % 1000000007;
  }
  ans = (n - ans) % 1000000007;
  for (h = 1; h < n; h++) ans = ans * h % 1000000007;
  if (ans < 0) ans += 1000000007;
  printf("%lld\n", ans);
  return 0;
}
