#include <bits/stdc++.h>
const int MAXN = 1E6 + 5;
const int MOD = 1E9 + 7;
int F[MAXN], S[MAXN]{};
int K, N, ret;
int mMI(int n) {
  int a = 0, b = 1, c, m = MOD, q;
  while (m && n) {
    c = b;
    b = a - b * (m / n);
    a = c;
    q = n;
    n = m % n;
    m = q;
  }
  if (a < 0) a += MOD;
  return a;
}
int count_perms(int n) {
  if (K >= n) return 0;
  return ((1LL * F[n - 2] *
           (((n - K - 1) + ((S[n - 1] - S[n - K - 1] + MOD) % MOD)) % MOD)) %
          MOD);
}
int main() {
  scanf(" %d%d", &N, &K);
  F[0] = 1;
  for (int i = 1; i <= N; ++i) F[i] = 1LL * F[i - 1] * i % MOD;
  S[0] = ret = 0;
  for (int i = 1; i <= N; ++i) {
    int P = count_perms(i);
    int inv_fac = mMI(F[i - 1]);
    ret = ((((((1LL * P * F[N - 1]) % MOD) * inv_fac) % MOD) + ret) % MOD);
    S[i] = ((((1LL * P * inv_fac) % MOD) + S[i - 1]) % MOD);
  }
  printf("%d\n", ret);
  return 0;
}
