#include <bits/stdc++.h>

using namespace std;

const int N = 1000005;
const int mod = 1e9 + 7;

int prd[N];
int inv[N];

int binPow(int x, int y) {
	if (!y) return 1;
	int ret = binPow(x, y >> 1); ret = 1LL * ret * ret % mod;
	if (y & 1) ret = 1LL * ret * x % mod; return ret;
}

inline int C(int n, int k) {
	if (n < k || k < 0) return 0;
	return 1LL * prd[n] * inv[k] % mod * inv[n - k] % mod;
}

int main() {
	int n; cin >> n;
	prd[0] = 1;
	for (int i = 1; i <= n; ++i) prd[i] = 1LL * prd[i - 1] * i % mod; 
	inv[n] = binPow(prd[n], mod - 2);
	for (int i = n; i >= 1; --i) inv[i - 1] = 1LL * inv[i] * i % mod;
	int res = 0, v0 = 0;
	for (int i = n & 1; i <= n - 2; i += 2) {
		int j = (n - 2 - i) / 2;
		int v1 = 1LL * C(i + j, i) * prd[i + j + 1] % mod * prd[n - 2 - i - j] % mod;
		int v2 = v1 - v0; if (v2 < 0) v2 += mod;
		v0 = v1;
		// cout << v2 << ' ' << i << ' ' << j << '\n';
		res = (res + 1LL * v2 * (i + j + 1)) % mod;
	}
	cout << res;
}