#include <bits/stdc++.h>
using namespace std;
const int MX = 1000005, mod = 1000000007;
int n, k;
long long fac[MX], inv[MX], dp[MX];
long long pot(long long b, int p) {
  long long res = 1;
  while (p) {
    if (p & 1) (res *= b) %= mod;
    (b *= b) %= mod;
    p /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fac[0] = inv[0] = 1;
  for (int i = 1; i < MX; i++) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = pot(fac[i], mod - 2);
  }
  cin >> n >> k;
  for (long long i = n, acu = fac[n - 1]; i >= 1; i--) {
    (acu += fac[i - 1] * dp[i + 1]) %= mod;
    dp[i] = acu * inv[i - 1] % mod;
    if (i + k <= n) (acu -= fac[i + k - 2] * dp[i + k]) %= mod;
  }
  cout << ((((fac[n] - dp[1]) % (mod)) + (mod)) % (mod)) << '\n';
  return 0;
}
