#include <bits/stdc++.h>
using namespace std;
void OpenFile() {
  freopen(
      "Maximum Element"
      ".INP",
      "r", stdin);
  freopen(
      "Maximum Element"
      ".OUT",
      "w", stdout);
}
const long long Mod = 1e9 + 7;
const int maxn = 1e6 + 1;
int n, k;
long long P[maxn], DivP[maxn], f[maxn], s[maxn], res;
void Enter() { cin >> n >> k; }
long long Pow(int a, int k) {
  if (k == 0) return 1;
  long long t = Pow(a, k / 2);
  t = t * t % Mod;
  if (k % 2) return t * a % Mod;
  return t;
}
void Init() {
  P[0] = 1;
  DivP[0] = 1;
  for (int i = 1; i <= n; ++i) {
    P[i] = P[i - 1] * i % Mod;
    DivP[i] = Pow(P[i], Mod - 2);
  }
}
void Solve() {
  f[k + 1] = P[k];
  s[k + 1] = f[k + 1] * DivP[k + 1] % Mod;
  for (int i = k + 2; i <= n; ++i) {
    f[i] = ((i - k) * P[i - 1] % Mod +
            (s[i - 1] - s[i - k - 1] + Mod) * P[i - 1] % Mod) %
           Mod;
    s[i] = (s[i - 1] + f[i] * DivP[i]) % Mod;
  }
  cout << s[n - 1] * P[n - 1] % Mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Enter();
  Init();
  Solve();
}
