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