#include <bits/stdc++.h>
using namespace std;
inline int read(register int ans = 0, register int sgn = ' ',
                register int ch = getchar()) {
  for (; ch < '0' || ch > '9'; sgn = ch, ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; (ans *= 10) += ch - '0', ch = getchar())
    ;
  return sgn - '-' ? ans : -ans;
}
char _Ob[1000000 + 5], *_O = _Ob, _Os[25], *_Ot;
template <typename T>
inline void Out(T x) {
  if (!x) {
    (*_O++ = '0');
    return;
  }
  if (x < 0) (*_O++ = '-'), x = -x;
  for (_Ot = _Os; x; *_Ot++ = x % 10 + '0', x /= 10)
    ;
  for (; _Ot != _Os; (*_O++ = *--_Ot))
    ;
  if (_O - _Ob >= 1000000 - 50) fwrite(_Ob, 1, _O - _Ob, stdout), _O = _Ob;
}
int g[1000000 + 5], s[1000000 + 5], efac[1000000 + 5], fac[1000000 + 5], n, k,
    ans;
inline int fastpow(int s, int n) {
  int a = 1;
  for (; n; n& 1 ? a = 1ll * a * s % 1000000007 : 0,
                   s = 1ll * s * s % 1000000007, n >>= 1)
    ;
  return a;
}
int main() {
  n = read(), k = read();
  fac[0] = 1;
  for (register int i = 1; i <= n;
       fac[i] = 1ll * i * fac[i - 1] % 1000000007, i++)
    ;
  efac[n] = fastpow(fac[n], 1000000007 - 2);
  for (register int i = n; i; efac[i - 1] = 1ll * i * efac[i] % 1000000007, i--)
    ;
  for (register int i = k + 1; i <= n;
       s[i] = (s[i - 1] + 1ll * g[i] * efac[i - 1]) % 1000000007, i++)
    g[i] = (i - k - 1ll + s[i - 1] + 1000000007 - s[i - k - 1]) % 1000000007 *
           fac[i - 2] % 1000000007;
  printf("%I64d\n", 1ll * fac[n - 1] * s[n] % 1000000007);
  return 0;
}
