#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int sum = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return f * sum;
}
const int N = 1000005;
const int Mod = 1000000007;
int n, K;
long long inv[N], g[N];
inline long long fpow(long long a, long long b) {
  long long ret = 1;
  for (; b; a = a * a % Mod, b >>= 1)
    if (b & 1) ret = ret * a % Mod;
  return ret;
}
signed main() {
  n = read();
  K = read();
  for (int i = 1; i <= n; i++) inv[i] = fpow(i, Mod - 2);
  g[0] = 1;
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    sum = (sum + g[i - 1]) % Mod;
    if (i > K) sum = (sum - g[i - K - 1]) % Mod, sum = (sum + Mod) % Mod;
    g[i] = sum;
    g[i] = g[i] * inv[i] % Mod;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = (ans + g[i - 1]) % Mod;
  ans = (n - ans) % Mod;
  ans = (ans + Mod) % Mod;
  for (int i = 1; i < n; i++) ans = ans * i % Mod;
  printf("%lld\n", ans);
  return 0;
}
