#include <bits/stdc++.h>
using namespace std;
const long long N = 1000005, p = 1000000007;
long long f[N], inv[N], ans, sum, fac = 1, n, k;
signed main() {
  scanf("%d%d", &n, &k);
  ans = n;
  inv[0] = f[0] = 1;
  for (long long i = 1; i <= n; i++) {
    inv[i] = (i ^ 1) ? 1ll * (p - p / i) * inv[p % i] % p : 1;
    (sum += ((i > k) ? f[i - 1] - f[i - k - 1] + p : f[i - 1])) %= p;
    f[i] = 1ll * sum * inv[i] % p;
    ans = (ans - f[i - 1] + p) % p;
    fac = 1ll * fac * ((i ^ 1) ? (i - 1) : 1) % p;
  }
  printf("%d\n", 1ll * fac * ans % p);
  return 0;
}
