#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
long long mod=1000000007;
long long ans=0;
int fac[2020202];
int ifac[2020202];
int C(int n,int m)
{
	if(n<m)
		return 0;
	return (long long)fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}
int main()
{
	int n,cnt,d,d1;
	scanf("%d",&n);
	n--;
	fac[0]=1;
	for(int i=1;i<=2000000;i++)
		fac[i]=(long long)fac[i-1]*i%mod;
	ifac[0]=ifac[1]=1;
	for(int i=2;i<=2000000;i++)
		ifac[i]=(long long)(mod-mod/i)*ifac[mod%i]%mod;
	for(int i=2;i<=2000000;i++)
		ifac[i]=(long long)ifac[i-1]*ifac[i]%mod;
	ans=(long long)(n+1)*fac[n]%mod;
	d=(n+1)/2;
	cnt=n/2+1;
	for(int i=cnt;i<=n;i++)
	{
		d1=d-(i-cnt);
		(ans-=(long long)fac[i]*C(i-d1+d1-1,d1-1)%mod*fac[n-i])%=mod;
	}
	printf("%lld",(ans+mod)%mod);
	return 0;
}