#include <bits/stdc++.h>
using namespace std;
int dp[1001000], n, k, fac[1001000], inv[1001000], f[1001000];
int main() {
  scanf("%d%d", &n, &k), fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; ++i)
    fac[i] = 1ll * fac[i - 1] * i % 1000000007,
    inv[i] = (i == 1 ? 1
                     : 1ll * inv[1000000007 % i] *
                           (1000000007 - 1000000007 / i) % 1000000007);
  for (int i = 1; i <= n; ++i) inv[i] = 1ll * inv[i] * inv[i - 1] % 1000000007;
  for (int i = 1; i <= k; ++i) dp[i] = 0;
  for (int i = k + 1; i <= n; ++i) {
    dp[i] = 1ll * fac[i - 2] *
            (i - k - 1 + (f[i - 1] - f[i - k - 1] + 1000000007)) % 1000000007;
    f[i] = (f[i - 1] + 1ll * dp[i] * inv[i - 1]) % 1000000007;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    ans = (ans + 1ll * dp[i] * inv[i - 1]) % 1000000007;
  printf("%d", 1ll * ans * fac[n - 1] % 1000000007);
}
