#include <bits/stdc++.h>
using namespace std;
int f[1000010], F[1000010], ine[1000010], n, k;
int main() {
  cin >> n >> k;
  F[0] = ine[0] = ine[1] = 1;
  for (int i = 2; i <= n; i++)
    ine[i] = (-1ll * ine[1000000007 % i] * (1000000007 / i) % 1000000007 +
              1000000007) %
             1000000007;
  for (int i = 1; i <= n; i++)
    F[i] = 1ll * F[i - 1] * i % 1000000007,
    ine[i] = 1ll * ine[i - 1] * ine[i] % 1000000007;
  for (int i = 1; i <= k; i++) f[i] = 0;
  for (int i = k + 2, sum = 0; i <= n; i++) {
    f[i] = 1ll * (i - k - 1) * F[i - 2] % 1000000007;
    f[i] = (f[i] + 1ll * sum * F[i - 2]) % 1000000007;
    sum = (sum + 1ll * f[i] * ine[i - 1]) % 1000000007;
    if (i - k >= 1)
      sum = (sum - 1ll * f[i - k] * ine[i - k - 1] % 1000000007 + 1000000007) %
            1000000007;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    ans = (ans + 1ll * f[i] * F[n - 1] % 1000000007 * ine[i - 1]) % 1000000007;
  cout << ans << endl;
  return 0;
}
