#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, p = 1e9 + 7;
int n, ans, fac[N], inv[N], f[N];
inline void A(int &x, int y) { x += y; if (x >= p) x -= p; }
inline int C(int x, int y) { return 1ll * fac[x] * inv[y] % p * inv[x - y] % p; }
int main() {
	scanf("%d", &n); --n;
	fac[0] = 1; for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % p;
	inv[0] = inv[1] = 1; for (int i = 2; i <= n; ++i) inv[i] = 1ll * inv[p % i] * (p - p / i) % p;
	for (int i = 2; i <= n; ++i) inv[i] = 1ll * inv[i] * inv[i - 1] % p;
	int bd = (n + 2) >> 1;
	for (int i = bd; i <= n; ++i) f[i] = 1ll * C(i - 1, n - i) * fac[n - i] % p * fac[i] % p;
	for (int i = n; i > bd; --i) A(f[i], p - f[i - 1]);
	int ans = 0;
	for (int i = bd; i <= n; ++i) A(ans, 1ll * f[i] * i % p);
	printf("%d\n", ans);
	return 0;
}
