#include <bits/stdc++.h>
using namespace std;
template <class T>
void gi(T &x) {
  int f;
  char c;
  for (f = 1, c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
  x *= f;
}
const int N = 1e6 + 10, mod = 1e9 + 7;
int Fac[N], inv[N], n, f[N];
inline int C(int n, int m) {
  return 1ll * Fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
  cin >> n;
  int ans = 0, li = (n + 1) / 2;
  Fac[0] = inv[0] = inv[1] = 1;
  for (int i = 1; i <= n; i++) Fac[i] = 1ll * Fac[i - 1] * i % mod;
  for (int i = 2; i <= n; i++)
    inv[i] = (mod - 1ll * (mod / i) * inv[mod % i] % mod) % mod;
  for (int i = 2; i <= n; i++) inv[i] = 1ll * inv[i] * inv[i - 1] % mod;
  for (int i = li; i < n; i++)
    f[i] = 1ll * C(i - 1, n - 1 - i) * Fac[i] % mod * Fac[n - 1 - i] % mod;
  for (int i = n - 1; i >= li; i--) f[i] = (f[i] - f[i - 1] + mod) % mod;
  for (int i = n - 1; i >= li; i--) ans = (ans + 1ll * i * f[i]) % mod;
  cout << ans << endl;
  return 0;
}
