#include <bits/stdc++.h>
const long long INF = 1e18L + 1;
const int IINF = 1e9 + 1;
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
const long long mod = 1e9 + 7;
long long int_pow(long long base, long long exp) {
  if (!exp) {
    return 1ll;
  } else if (exp & 1) {
    return (base * int_pow((base * base) % mod, exp / 2)) % mod;
  } else {
    return int_pow((base * base) % mod, exp / 2);
  }
}
const int N = 1e6;
long long res[N + 1];
long long push_back[N + 1];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  k++;
  for (long long i = (long long)k; i < (long long)n; i++) {
    push_back[i] = (push_back[i - 1] +
                    (mod + 1 - push_back[i - k]) * int_pow(i, mod - 2)) %
                   mod;
    res[i] =
        (res[i - 1] + (mod + 1 - push_back[i - k]) * int_pow(i, mod - 2) % mod *
                          int_pow(n, mod - 2) % mod * (n - i) % mod) %
        mod;
    (i, res[i - k], res[i]);
  }
  long long ans = res[n - 1];
  for (long long i = (long long)1; i < (long long)n + 1; i++) {
    ans = (ans * i) % mod;
  }
  cout << ans << "\n";
  return 0;
}
