#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 9;
long long fac[N];
long long BigMod(long long a, long long n) {
  if (n == 0) return 1;
  long long x = BigMod(a, n / 2);
  x = (x * x) % mod;
  if (n & 1) x = (a * x) % mod;
  return x;
}
long long ModInv(long long a) { return BigMod(a, mod - 2); }
void solve() {
  long long n;
  cin >> n;
  fac[0] = 1;
  long long ans = 0;
  for (long long i = 1; i < N; i++) fac[i] = (fac[i - 1] * i) % mod;
  for (long long i = n / 2; i < n; i++) {
    ans += ((2 * fac[n - 1]) * ModInv((fac[i] * fac[n - i - 1]) % mod)) % mod;
    if (n & 1 && i == (n / 2)) ans *= (ModInv(2LL));
    ans %= mod;
  }
  cout << (fac[n] - ans + mod) % mod << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) solve();
  return 0;
}
