#include<bits/stdc++.h>
#define int long long
inline int read(){
	char c=getchar();while (c!='-'&&(c<'0'||c>'9'))c=getchar();
	int k=1,kk=0;if (c=='-')c=getchar(),k=-1;
	while (c>='0'&&c<='9')kk=kk*10+c-'0',c=getchar();return kk*k;
}using namespace std;
void write(int x){if (x<0)putchar('-'),x=-x;if (x/10)write(x/10);putchar(x%10+'0');}
void writeln(int x){write(x);puts("");}
int n,lsg,jc[1000010],N[1000010],ans,f[1000010],sum;
int ksm(int x,int y){
	int ans=1;while (y){
		if (y&1)(ans*=x)%=lsg;(x*=x)%=lsg;y>>=1;
	}return ans;
}int p(int n,int m){return jc[n]*N[m]%lsg;}
int C(int n,int m){return jc[n]*N[m]%lsg*N[n-m]%lsg;}
signed main(){
	n=read();lsg=1e9+7;if (n==2){puts("1");return 0;}
	jc[0]=1;for (int i=1;i<=n;i++)jc[i]=jc[i-1]*i%lsg;
	N[n]=ksm(jc[n],lsg-2);for (int i=n-1;i>=0;i--)N[i]=N[i+1]*(i+1)%lsg;
	for (int i=1;i<n;i++)if (i*2>=n){
		f[i]=C((n-2-(i*2-n))/2+i*2-n,i*2-n)*jc[i]%lsg*jc[n-1-i]%lsg;
		(ans+=(f[i]-f[i-1])*i%lsg+lsg)%=lsg;
	}writeln(ans);
}

