#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
  putchar(' ');
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
using namespace std;
int n, k;
long long gt[1000005], sum[1000005], dp[1000005];
long long poww(long long a, long long b) {
  if (b == 1) return a % 1000000007;
  long long ans = poww(a, b / 2);
  if (b % 2) return (((ans * ans) % 1000000007) * a) % 1000000007;
  return (ans * ans) % 1000000007;
}
void setup(long long res = 0) {
  read(n);
  read(k);
  if (k >= n) {
    cout << 0;
    exit(0);
  }
  gt[0] = 1;
  for (int i = (1); i <= (n); i++) gt[i] = (gt[i - 1] * i) % 1000000007;
  for (int i = (k + 1); i <= (n); i++) {
    long long ans1 = ((i - k - 1) * gt[i - 2]) % 1000000007;
    long long ans2 =
        (((gt[i - 2] * (sum[i - 1] - sum[i - k - 1]) % 1000000007) %
          1000000007)) %
        1000000007;
    dp[i] = (ans1 + ans2) % 1000000007;
    sum[i] =
        (sum[i - 1] + (dp[i] * poww(gt[i - 1], 1000000007 - 2)) % 1000000007) %
        1000000007;
  }
  for (int i = (1); i <= (n); i++)
    res = (res + (((dp[i] * gt[n - 1]) % 1000000007) *
                  poww(gt[i - 1], 1000000007 - 2)) %
                     1000000007) %
          1000000007;
  write(((res % 1000000007) + 1000000007) % 1000000007);
}
void work() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  setup();
  work();
  return 0;
}
