#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 4, mod = 1e9 + 7;
long long x, y, g, fac[N], dp[N], n, k, ans;
long long xgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1, gcd = xgcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - (long long)(a / b) * y1;
  return gcd;
}
long long entekhab(long long r, long long n) {
  if (r == 0) return 1;
  long long ans = 1;
  ans = fac[n];
  x = 1, y = 1, g = xgcd(fac[r], mod, x, y);
  ans = (ans * ((x + mod) % mod)) % mod;
  x = 1, y = 1, g = xgcd(fac[n - r], mod, x, y);
  ans = ((ans * ((x + mod) % mod))) % mod;
  return ans;
}
int main() {
  fac[0] = 1;
  for (long long i = 1; i < N; i++) fac[i] = (fac[i - 1] * i) % mod;
  cin >> n >> k;
  dp[k + 1] = fac[k];
  for (long long i = k + 2; i < n; i++) {
    dp[i] = (dp[i - 1] * i) % mod;
    dp[i] = (dp[i] + (((entekhab(k, i - 1) *
                        ((fac[i - k - 1] + mod - dp[i - k - 1]) % mod)) %
                       mod) *
                      fac[k])) %
            mod;
  }
  for (long long i = k + 1; i < n; i++) {
    ans = (ans + ((dp[i] * fac[n - i - 1]) % mod) * entekhab(i, n - 1)) % mod;
  }
  cout << ans;
}
