#include<bits/stdc++.h>
#define ll long long
#define rg register
using namespace std;
const int Mod=1e9+7;
const int MAXN=1e6+10;
int n,k;
ll Ans,Tot,Mi[MAXN]={1};
inline int Read()
{   rg int a=0,c=1;   rg char b=getchar();
	while(b!='-'&&(b<'0'||b>'9'))b=getchar();
	if(b=='-')c=-1,b=getchar();
	while(b>='0'&&b<='9')a=a*10+b-48,b=getchar();
	return a*c;
}
inline ll Fast(rg ll Di,rg ll Mi)
{   ll Back=1;
	while(Mi>=1)
	{   if(Mi&1)  Back=(Back*Di)%Mod;
		Di=(Di*Di)%Mod;   Mi>>=1;
	}
	return Back;
}
int main()
{   n=Read();   k=(n+1)/2;
	for(rg int i=1;i<=n;i++)  Mi[i]=(Mi[i-1]*i)%Mod;
	for(rg int i=k;i<=n-1;i++)
	{   ll x=2*i-n,y=n-i-1,Now=0,Size=Tot;
		Now=((Mi[i-1]*Fast(Mi[x]*Mi[y]%Mod,Mod-2)%Mod)*Mi[i]%Mod*Mi[y])%Mod;
		Tot=Now;   Now-=Size;   Now=(Now%Mod+Mod)%Mod;
		Ans=(Ans+1ll*Now*i)%Mod;
	}
	printf("%lld\n",Ans);
}
