#include<bits/stdc++.h>
#define LL long long
using namespace std;
int n;
const int N=1000010,mod=1e9+7;
LL ans;
LL jc[N],inv[N],f[N];
inline LL ksm(LL a,LL b,LL mod)
{
	LL res=1;
	for(;b;b>>=1,a=a*a%mod)
		if(b&1)res=res*a%mod;
	return res;
}
inline int read()
{
	int res = 0; char ch = getchar(); bool XX = false;
	for (; !isdigit(ch); ch = getchar())(ch == '-') && (XX = true);
	for (; isdigit(ch); ch = getchar())res = (res << 3) + (res << 1) + (ch ^ 48);
	return XX ? -res : res;
}
inline void YYCH()
{
	jc[0]=jc[1]=inv[0]=inv[1]=1;
	for(int i=1;i<=n;++i)jc[i]=jc[i-1]*i%mod;
	inv[n]=ksm(jc[n],mod-2,mod);
	for(int i=n-1;i>=1;--i)inv[i]=inv[i+1]*(i+1)%mod;
}
inline LL C(LL n,LL m){return jc[n]*inv[m]%mod*inv[n-m]%mod;}
int main()
{
	cin>>n;
	YYCH();
	for(int i=(n+1)>>1;i<=n-1;++i)
	{
		f[i]=C(i-1,n-i-1)*jc[i]%mod*jc[n-1-i]%mod;
		(((ans+=(f[i]-f[i-1])*i%mod)%=mod)+=mod)%=mod;
	}
	cout<<ans;
	return 0;
}