#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000006;
const int MOD = 1000000007;
int n;
int fact[MAXN];
int ifact[MAXN];
long long ADD(long long a, long long b) { return (a + b) % MOD; }
long long SUB(long long a, long long b) { return (a - b + MOD) % MOD; }
long long MUL(long long a, long long b) { return a * b % MOD; }
long long POW(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2) return MUL(a, POW(a, b - 1));
  long long v = POW(a, b / 2);
  return MUL(v, v);
}
long long DIV(long long a, long long b) { return MUL(a, POW(b, MOD - 2)); }
void init() {
  fact[0] = 1;
  ifact[0] = 1;
  for (int i = 1; i < MAXN; ++i) {
    fact[i] = MUL(fact[i - 1], i);
    ifact[i] = POW(fact[i], MOD - 2);
  }
}
int bc(int n, int k) { return MUL(MUL(fact[n], ifact[k]), ifact[n - k]); }
int main() {
  init();
  scanf("%d", &n);
  int prevc = 0, sol = 0;
  for (int i = (n + 1) / 2; i < n; ++i) {
    int c = MUL(bc(i - 1, n - i - 1), fact[i]);
    sol = ADD(sol, MUL(SUB(c, prevc), i));
    prevc = c;
  }
  printf("%d", sol);
}
