#include <bits/stdc++.h>
using namespace std;
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
const int N = 1001005;
const int _p = 1e9 + 7;
long long inv[N], s = 0, ans = 0, fac[N], dp[N];
int n, k;
void init() {
  inv[0] = inv[1] = fac[0] = 1;
  for (int i = 2; i <= n + 10; i++) inv[i] = (_p - _p / i) * inv[_p % i] % _p;
  for (int i = 1; i <= n + 10; i++) inv[i] = inv[i - 1] * inv[i] % _p;
  for (int i = 1; i <= n + 10; i++) fac[i] = fac[i - 1] * i % _p;
}
int main() {
  scanf("%d%d", &n, &k);
  init();
  for (int i = k + 1; i <= n; i++) {
    dp[i] = (s + i - k - 1) % _p * fac[i - 2] % _p;
    (s += (dp[i] * inv[i - 1] % _p - dp[i - k] * inv[i - k - 1] % _p) % _p) %=
        _p;
  }
  for (int i = 1; i <= n; i++) (ans += dp[i] * inv[i - 1] % _p) %= _p;
  (ans *= fac[n - 1]) %= _p;
  printf("%I64d\n", ans < 0 ? ans + _p : ans);
  return 0;
}
