#include <bits/stdc++.h>
using namespace std;
int n, k;
long long g[1000005];
long long inv[1000005];
long long jiesum, sum, ans;
int main() {
  scanf("%d%d", &n, &k);
  if (n <= k) return printf("0"), 0;
  g[0] = jiesum = 1;
  inv[1] = 1;
  ans = 1ll * n;
  for (int i = 1; i <= n; ++i) {
    if (i > 1)
      inv[i] = (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;
    if (i > 1) jiesum = jiesum * (i - 1) % 1000000007;
    sum = (sum + g[i - 1]) % 1000000007;
    if (i > k) sum = (sum - g[i - k - 1] + 1000000007) % 1000000007;
    g[i] = sum * inv[i] % 1000000007;
    ans = (ans - g[i - 1] + 1000000007) % 1000000007;
  }
  printf("%lld", ans * jiesum % 1000000007);
  return 0;
}
