#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
#define SIZE 2100000
ll inv[SIZE + 1];
ll kai[SIZE + 1];
ll invkai[SIZE + 1];
void invinit()
{
	inv[1] = 1;
	for (int i = 2; i <= SIZE; i++)
	{
		inv[i] = mod - (mod / i)*inv[mod%i] % mod;
	}
	kai[0] = invkai[0] = 1;
	for (int i = 1; i <= SIZE; i++)
	{
		kai[i] = kai[i - 1] * i%mod;
		invkai[i] = invkai[i - 1] * inv[i] % mod;
	}
}
ll com(ll a, ll b)
{
	if (b < 0 || a < b)return 0;
	return (invkai[b] * invkai[a - b]) % mod*kai[a] % mod;
}
ll d[1010101];
int main()
{
	int num;
	scanf("%d", &num);
	num--;
	invinit();
	ll ans = 0;
	for (int i = 0; i <= num / 2; i++)d[i] = com(num - 1 - i, i)*kai[i] % mod*kai[num - i] % mod;
	for (int i = 0; i <= num / 2; i++)ans = (ans + (d[i] + mod - d[i + 1])*(num - i)) % mod;
	printf("%lld\n", ans);
}