#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
#define N 1200000

const LL mod=1000000007;
LL n,fac[N],ifac[N],ans,f[N];

void upd(LL &x,LL y){x=(x+y)%mod;}

LL inv(LL x){
	return x==1?1:(mod-mod/x)*inv(mod%x)%mod;
}

LL C(LL x,LL y){
	return x<y||y<0?0:fac[x]*ifac[y]%mod*ifac[x-y]%mod;
}

int main(){
	scanf("%lld",&n);
	fac[0]=1; for (LL i=1;i<=n;++i) fac[i]=fac[i-1]*i%mod;
	ifac[n]=inv(fac[n]); for (LL i=n-1;~i;--i) ifac[i]=ifac[i+1]*(i+1)%mod;
	for (LL i=1;i<n;++i){
		f[i]=C(i-1,n-1-i)*fac[i]%mod*fac[n-i-1]%mod;
		upd(ans,(f[i]-f[i-1])*i);
	}
	upd(ans,mod);
	printf("%lld\n",ans);
	
	return 0;
}
			