#include <bits/stdc++.h>
const int N = 1000007, P = 1000000007;
int inv[N], f[N];
int main() {
  int n, m, fac = 1;
  scanf("%d%d", &n, &m), inv[0] = inv[1] = 1;
  if (n <= m) m = n - 1;
  for (int i = 2; i < n; ++i)
    inv[i] = 1ll * (P - P / i) * inv[P % i] % P, fac = 1ll * i * fac % P;
  for (int i = 0; i <= m; ++i) f[i] = i + 1;
  for (int i = m + 1; i < n; ++i)
    f[i] = (1ll * (f[i - 1] - f[i - m - 1] + P) * inv[i] + f[i - 1]) % P;
  printf("%lld", 1ll * fac * (n - f[n - 1] + P) % P);
}
