#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
const int max_n = 1000000 + 5;
const long long modref = ((long long)(1e9 + 7));
long long f[max_n + 1], fi[max_n + 1];
long long fpow(long long a, long long p) {
  if (p == 0ll)
    return 1ll;
  else {
    long long t = fpow(a, p / 2ll);
    t = (t * t) % modref;
    if (p & 1ll) t = (t * a) % modref;
    return t;
  }
}
long long choose(long long a, long long b) {
  return (((fi[b] * fi[a - b]) % modref) * f[a]) % modref;
}
int n, k;
long long q[max_n];
long long pq[max_n + 1];
long long res = 0ll;
int main() {
  f[0] = 1ll;
  fi[0] = 1ll;
  for (int i = 1; i <= max_n; ++i) {
    f[i] = (f[i - 1] * ((long long)(i))) % modref;
    fi[i] = fpow(f[i], modref - 2ll);
  }
  scanf("%d", &n);
  scanf("%d", &k);
  if (k >= n - 1) {
    cout << 0ll << "\n";
    return 0;
  }
  pq[0] = 0ll;
  for (int i = 0; i <= n - 1 - k; ++i) {
    if (i <= k)
      q[i] = f[i];
    else
      q[i] = (f[i - 1] * (pq[i] - pq[i - k] + modref)) % modref;
    pq[i + 1] = (pq[i] + q[i] * fi[i]) % modref;
  }
  for (int i = k + 1; i <= n - 1; ++i) {
    long long dres = (choose(n - 1, i) * f[n - i]) % modref;
    dres = (dres * choose(i - 1, k)) % modref;
    dres = (dres * f[k]) % modref;
    dres = (dres * q[i - k - 1]) % modref;
    res = (res + dres) % modref;
  }
  cout << res << "\n";
  return 0;
}
