#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long t = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) t = t * 10 + c - '0', c = getchar();
  return t * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline void write_p(long long x) {
  write(x);
  putchar(' ');
}
long long n, mod = 1e9 + 7, fac[1000010], N[1000010], ans, f[1000010], sum;
long long ksm(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) (ans *= x) %= mod;
    (x *= x) %= mod;
    y >>= 1;
  }
  return ans;
}
long long p(long long n, long long m) { return fac[n] * N[m] % mod; }
long long C(long long n, long long m) {
  return fac[n] * N[m] % mod * N[n - m] % mod;
}
int main() {
  n = read();
  if (n == 2) {
    puts("1");
    return 0;
  }
  fac[0] = 1;
  for (long long i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % mod;
  N[n] = ksm(fac[n], mod - 2);
  for (long long i = n - 1; i >= 0; --i) N[i] = N[i + 1] * (i + 1) % mod;
  for (long long i = 1; i < n; i++)
    if (i * 2 >= n) {
      f[i] = C((n - 2 - (i * 2 - n)) / 2 + i * 2 - n, i * 2 - n) * fac[i] %
             mod * fac[n - 1 - i] % mod;
      (ans += (f[i] - f[i - 1]) * i % mod + mod);
      ans %= mod;
    }
  writeln(ans);
}
