#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vll = vector<ll>;
using vs = vector<string>;
constexpr int MOD = 1000000007, N = 1000005;
int f[N], g[N];
ll mod_pow(ll a, ll b) {
  if (!b) return 1;
  return ((mod_pow(((a * a) % MOD), b / 2) * (b % 2 ? a : 1)) % MOD);
}
ll mod_inv(ll a) { return mod_pow(a, MOD - 2); }
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  ll fac = 1;
  f[0] = g[1] = 1;
  for (auto i = (1); i < (n); i++) {
    fac = ((fac * i) % MOD);
    int sum = g[i];
    if (i >= k) sum = ((sum - g[i - k] + MOD) % MOD);
    f[i] = ((mod_inv(i) * sum) % MOD);
    g[i + 1] = ((f[i] + g[i]) % MOD);
  }
  printf("%d\n", (int)((fac * ((n - g[n] + MOD) % MOD)) % MOD));
  return 0;
}
