#include <bits/stdc++.h>
using namespace std;
namespace MOD {
const int N = 1 << 20;
const int mod = 1e9 + 7;
int expmod(int x, int y, int z) {
  int ret = 1;
  for (; y; y >>= 1, x = 1ll * x * x % z)
    if (y & 1) ret = 1ll * ret * x % z;
  return ret;
}
int fac[N], rfac[N], inv[N];
void init() {
  fac[0] = inv[1] = rfac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  for (int i = 2; i < N; i++)
    inv[i] = mod - 1ll * inv[mod % i] * (mod / i) % mod;
  for (int i = 1; i < N; i++) rfac[i] = 1ll * rfac[i - 1] * inv[i] % mod;
}
}  // namespace MOD
using namespace MOD;
int f[N], s[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  MOD::init();
  int n, k;
  cin >> n >> k;
  f[0] = 1, s[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = s[i - 1];
    if (i - k - 1 >= 0) {
      f[i] -= s[i - k - 1];
      if (f[i] < 0) f[i] += mod;
    }
    f[i] = 1ll * f[i] * inv[i] % mod;
    s[i] += s[i - 1] + f[i];
    if (s[i] >= mod) s[i] -= mod;
  }
  int ans = (fac[n] - 1ll * s[n - 1] * fac[n - 1]) % mod;
  if (ans < 0) ans += mod;
  cout << ans << endl;
}
