#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long tavmd(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2 == 0) {
    long long x = tavmd(a, b / 2);
    return (x * x) % MOD;
  } else {
    return (a % MOD * tavmd(a, b - 1) % MOD) % MOD;
  }
}
const long long lNF = 3e18;
long long dp[1000100], ps[1000100], f[1000100], inv[1000100];
int main() {
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k, ans = 0;
  cin >> n >> k;
  f[0] = 1;
  inv[0] = 1;
  dp[1] = 1;
  for (int j = 1; j < 1000100; j++) {
    f[j] = (f[j - 1] * j) % MOD;
    inv[j] = tavmd(f[j], MOD - 2);
  }
  for (int i = 1; i <= n; i++) {
    if (k <= i && i != 1) {
      dp[i] = (ps[i] - ps[i - k] + MOD) % MOD * f[i - 2] % MOD;
    } else if (i != 1)
      dp[i] = (ps[i] - ps[0] + MOD) % MOD * f[i - 2] % MOD;
    ps[i + 1] = (ps[i] + dp[i] * inv[i - 1]) % MOD;
  }
  for (int i = 1; i <= n; i++)
    ans = (ans + dp[i] * f[n - i] % MOD * f[n - 1] % MOD * inv[n - i] % MOD *
                     inv[i - 1] % MOD) %
          MOD;
  cout << (f[n] - ans + MOD) % MOD;
  return 0;
}
