#include <bits/stdc++.h>
using namespace std;
long long Fac[1000010], Inv[1000010], inv[1000010];
void ini() {
  Fac[0] = Inv[0] = Fac[1] = Inv[1] = inv[1] = 1;
  for (int i = 2; i < 1000010; i++) {
    Fac[i] = Fac[i - 1] * i % 1000000007;
    inv[i] = inv[1000000007 % i] * (1000000007 - 1000000007 / i) % 1000000007;
    Inv[i] = Inv[i - 1] * inv[i] % 1000000007;
  }
}
long long C(int n, int m) {
  return Fac[n] * Inv[m] % 1000000007 * Inv[n - m] % 1000000007;
}
long long dp[1000010];
long long tmp = 0;
void add(int x) { tmp = (tmp + dp[x] * Inv[x]) % 1000000007; }
void del(int x) { tmp = (tmp - dp[x] * Inv[x]) % 1000000007; }
int main() {
  ini();
  int n, k;
  scanf("%d %d", &n, &k);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    add(i - 1);
    if (i - k - 1 >= 0) del(i - k - 1);
    dp[i] = (Fac[i - 1] * tmp % 1000000007 + 1000000007) % 1000000007;
  }
  long long res = Fac[n];
  for (int i = 1; i <= n; i++) {
    res = (res - dp[i - 1] * C(n - 1, i - 1) % 1000000007 * Fac[n - i]) %
          1000000007;
  }
  cout << (res + 1000000007) % 1000000007;
  return 0;
}
