#include <bits/stdc++.h>
using namespace std;
long long dp[1000010];
int n, k;
long long f[1000010], c[1000010];
long long nck(long long n, long long k) {
  if (n < k) return 0;
  long long ret = (f[n] * c[k]) % 1000000007;
  return (ret * c[n - k]) % 1000000007;
}
long long npk(long long n, long long k) {
  if (n < k) return 0;
  return f[n] * c[n - k] % 1000000007;
}
long long pwr(long long b, long long e) {
  b %= 1000000007;
  if (e == 0) return 1;
  if (e == 1) return b;
  return (pwr(b * b, e / 2) * pwr(b, e % 2)) % 1000000007;
}
void init() {
  f[0] = c[0] = 1;
  for (int i = 1; i < 1000010; i++) (f[i] = f[i - 1] * i) %= 1000000007;
  c[1000010 - 1] = pwr(f[1000010 - 1], 1000000007 - 2);
  for (int i = 1000010 - 2; i; i--) (c[i] = c[i + 1] * (i + 1)) %= 1000000007;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long tot = 0;
  init();
  cin >> n >> k;
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i % 1000000007;
  for (int i = k + 1; i <= n; i++) {
    dp[i] = (i - k - 1) * f[i - 2] % 1000000007 + f[i - 2] * tot % 1000000007;
    dp[i] %= 1000000007;
    tot -= dp[i - k] * c[i - k - 1] % 1000000007;
    tot += dp[i] * c[i - 1] % 1000000007;
    tot %= 1000000007;
    if (tot < 0) tot += 1000000007;
  }
  long long res = 0;
  for (int i = 1; i <= n; i++)
    (res += dp[i] * npk(n - 1, n - i) % 1000000007) %= 1000000007;
  cout << res << endl;
  return 0;
}
