#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.push_back(move(x));
  return v;
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\n';
  err(++it, args...);
}
int N, K;
long long f[1000013];
long long finv[1000013];
long long A[1000013];
long long B[1000013];
long long modinv(long long x) {
  long long A[31];
  A[0] = x;
  for (int i = 0; i < 30; i++) {
    A[i + 1] = (A[i] * A[i]) % 1000000007;
  }
  long long ret = 1;
  for (int i = 0; i <= 30; i++) {
    if ((1 << i) & (1000000007 - 2)) {
      ret = (ret * A[i]) % 1000000007;
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> K;
  finv[0] = 1;
  f[0] = 1;
  for (int i = 1; i <= N; i++) {
    finv[i] = (finv[i - 1] * modinv(i)) % 1000000007;
    f[i] = (f[i - 1] * i) % 1000000007;
  }
  A[0] = B[0] = 1;
  long long cur = 1;
  long long fact = 1;
  for (int n = 1; n <= N - 1; n++) {
    A[n] = (cur * fact) % 1000000007;
    fact = (fact * n) % 1000000007;
    if (n - K >= 0) {
      cur = (cur + 1000000007 - B[n - K]) % 1000000007;
    }
    B[n] = (A[n] * finv[n]) % 1000000007;
    cur = (cur + B[n]) % 1000000007;
  }
  long long ans = 0;
  for (int k = 0; k < N; k++) {
    long long cur = B[k];
    cur *= f[N - 1];
    cur %= 1000000007;
    ans = (ans + cur) % 1000000007;
  }
  ans = (f[N] - ans + 1000000007) % 1000000007;
  cout << ans << endl;
  return 0;
}
