#include <bits/stdc++.h>
using namespace std;
long long ka[1145140], inv[1145140];
void setkaijo(long long n) {
  ka[0] = 1;
  for (long long i = 1; i <= n; i++) {
    ka[i] = ka[i - 1] * i;
    ka[i] %= 1000000007;
  }
}
long long modpow(long long x, long long k) {
  long long res = 1;
  while (k > 0) {
    if (k % 2) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    k >>= 1;
  }
  return res;
}
void setinv(long long n) {
  for (long long i = 0; i <= n; i++) {
    inv[i] = modpow(ka[i], (long long)1000000007 - 2);
  }
}
long long comb(long long n, long long k) {
  if (k < 0 || n < 0 || k > n) return 0;
  if (k == 0 || k == n) return 1;
  long long res = (ka[n] * inv[k]) % 1000000007;
  res = (res * inv[n - k]) % 1000000007;
  return res;
}
signed main() {
  long long n;
  cin >> n;
  setkaijo(1114514);
  setinv(1114514);
  long long mi = n / 2 + n % 2;
  long long ma = n - 1;
  long long ans = 0;
  long long sum = 0;
  for (long long i = mi; i <= ma; i++) {
    long long tmp = 1;
    tmp *= comb(i - 1, n - i - 1);
    tmp *= ka[i];
    tmp %= 1000000007;
    tmp *= ka[n - 1 - i];
    tmp %= 1000000007;
    tmp += 1000000007 - sum;
    tmp %= 1000000007;
    ans += tmp * i;
    ans %= 1000000007;
    sum += tmp;
    sum %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
