#include <bits/stdc++.h>
using namespace std;
template <class T>
T smin(T &a, T b) {
  if (a > b) a = b;
  return a;
}
template <class T>
T smax(T &a, T b) {
  if (a < b) a = b;
  return a;
}
const int N = (int)(1e6) + 5;
const int mod = 1e9 + 7;
int dp[N];
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (1ll * ans * a) % mod;
    b /= 2;
    a = (1ll * a * a) % mod;
  }
  return ans;
}
int main(void) {
  int n, k;
  cin >> n >> k;
  dp[0] = 1;
  int cnt = 1;
  for (int i = 1; i <= k; ++i) cnt = (1ll * cnt * i) % mod;
  for (int i = 1; i <= n + 5; ++i) {
    dp[i] = (dp[i - 1] * 1ll * (i + 1)) % mod;
    if (i >= k + 1) {
      int sub = (1ll * cnt * dp[i - k - 1]) % mod;
      dp[i] = (dp[i] + mod - sub) % mod;
      cnt = (1ll * cnt * pow(i - k, mod - 2)) % mod;
      cnt = (1ll * cnt * i) % mod;
    }
  }
  int ans = 1;
  for (int i = 1; i <= n; ++i) ans = (1ll * ans * i) % mod;
  ans = (ans + mod - dp[n - 1]) % mod;
  cout << ans << '\n';
  return 0;
}
