#include <bits/stdc++.h>
using namespace std;
template <class T>
bool cmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool cmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int mod = 1e9 + 7;
void madd(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int mul(int a, int b) { return (1LL * a * b) % mod; }
int mpow(int a, int n) {
  int r = 1;
  while (n > 0) {
    if (n & 1) r = mul(r, a);
    a = mul(a, a);
    n >>= 1;
  }
  return r;
}
int inv(int x) { return mpow(x, mod - 2); }
int add(int x, int y) {
  madd(x, y);
  if (x < 0) x += mod;
  return x;
}
const int N = 1e6 + 10;
int n, k;
int fa[N];
int fi[N];
int D[N];
int S[N];
int bino(int n, int k) { return mul(fa[n], mul(fi[k], fi[n - k])); }
int choose(int n, int k) { return mul(fa[n], fi[n - k]); }
int solve() {
  if (n <= k + 1) {
    return 0;
  }
  fa[0] = fi[0] = 1;
  for (int i = 1; i < N; i++) {
    fa[i] = mul(fa[i - 1], i);
    fi[i] = mul(fi[i - 1], inv(i));
  }
  for (int i = k + 2; i <= n; i++) {
    int s = i - k - 1;
    madd(s, add(S[i - 1], -S[i - k - 1]));
    D[i] = mul(fa[i - 2], s);
    S[i] = S[i - 1];
    madd(S[i], mul(D[i], fi[i - 1]));
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int pi = mul(D[i], choose(n - 1, n - i));
    madd(ans, pi);
  }
  return ans;
}
int main() {
  while (scanf("%d%d", &n, &k) != EOF) {
    memset(D, 0, sizeof D);
    memset(S, 0, sizeof S);
    printf("%d\n", solve());
  }
  return 0;
}
