#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
long long fac[2000100], Ifac[2010000];
inline long long C(long long x, long long y) {
  return fac[x] * Ifac[y] % mod * Ifac[x - y] % mod;
}
int n;
int main() {
  cin >> n;
  fac[0] = Ifac[0] = 1;
  for (register int i = 1; i <= 2 * n; ++i) fac[i] = fac[i - 1] * i % mod;
  Ifac[2 * n] = ksm(fac[2 * n], mod - 2);
  for (register int i = 2 * n - 1; i; --i)
    Ifac[i] = Ifac[i + 1] * (i + 1) % mod;
  long long ans = 0, las = 0;
  for (register int i = (n + 1) / 2; i <= n - 1; ++i) {
    long long tmp =
        1ll * C(i - 1, n - i - 1) * fac[i] % mod * fac[n - 1 - i] % mod;
    ans = ans + (tmp - las) * i % mod + mod;
    ans %= mod;
    las = tmp;
  }
  cout << ans;
  return 0;
}
