#include <bits/stdc++.h>
using namespace std;
const int N = 1000005, Mod = 1000000007;
int dp[N], inv[N], fac[N], sum[N];
inline int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (1ll * ans * a) % Mod;
    a = (1ll * a * a) % Mod, b >>= 1;
  }
  return ans;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % Mod;
  inv[n] = qpow(fac[n], Mod - 2);
  for (int i = n - 1; i >= 1; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % Mod;
  for (int i = 1; i <= n; i++)
    if (i > k) {
      dp[i] = 1ll * fac[i - 2] *
              ((i - k - 1) + sum[i - 1] - sum[i - k - 1] + Mod) % Mod;
      sum[i] = (sum[i - 1] + 1ll * dp[i] * inv[i - 1]) % Mod;
    }
  printf("%d", 1ll * sum[n] * fac[n - 1] % Mod);
  return 0;
}
