#include<bits/stdc++.h>
#define rep(i,a,b) for (int i=(a); i<=(b); i++)
using namespace std;

const int MOD = 1000000007;
const int maxn = 1000005;
int fac[maxn], rev[maxn];
int n, ans, res;

inline int power(int x, int p) {
	int res = 1;
	while (p) {
		if (p&1) res = 1LL * res * x % MOD;
		x = 1LL * x * x % MOD; p >>= 1;
	}
	return res;
}

inline int C(int n, int m) {
	if (m < 0 || m > n) return 0;
	return 1LL * fac[n] * rev[m] % MOD * rev[n-m] % MOD;
}

int main() {
	scanf("%d", &n); n--;
	fac[0] = rev[0] = 1;
	rep (i, 1, maxn-1) {
		fac[i] = 1LL * fac[i-1] * i % MOD;
		rev[i] = power(fac[i], MOD - 2);
	}
	ans = 1LL * n * fac[n] % MOD;
	rep (i, 0, n-3) if (i <= n-2-i-1) {
		res = (res + 1LL * C(n-2-i-1, i) * (n-2-i) % MOD * fac[n-i-1] % MOD * fac[i]) % MOD;
		// printf("%d\n", res);
	}
	ans = (ans + MOD - res) % MOD;
	printf("%d\n", ans);
	return 0;
}