#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("avx")
using namespace std;
int dp[1000001], sum[1000001], f[1000001] = {1}, rev[1000001];
inline int inv(int x) {
  if (x < 2) return x;
  return (long long)1000000007 / x * (1000000007 - inv(1000000007 % x)) %
         1000000007;
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) f[i] = (long long)i * f[i - 1] % 1000000007;
  rev[n] = inv(f[n]);
  for (int i = n; i--;) rev[i] = (long long)(i + 1) * rev[i + 1] % 1000000007;
  for (int i = 0; i <= k; i++) dp[i] = f[i], sum[i] = i + 1;
  for (int i = k; i <= n; i++) {
    dp[i] = (long long)f[i - 1] * (sum[i - 1] - sum[i - k - 1] + 1000000007) %
            1000000007;
    sum[i] = (sum[i - 1] + (long long)dp[i] * rev[i]) % 1000000007;
  }
  printf("%d",
         (f[n] - (long long)sum[n - 1] * f[n - 1] % 1000000007 + 1000000007) %
             1000000007);
}
