#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long LL;
const LL mo=1e9+7;
const int N=1e6;
int n;
LL fac[N+10],inv[N+10],f[N+10];
LL mul(LL x,LL y) {
    LL z=1;
    while (y) {
	if (y&1) z=z*x%mo;
	x=x*x%mo;
	y>>=1;
    }
    return z;
}
void pre() {
    fac[0]=1;
    for (int i=1;i<=N;i++) fac[i]=fac[i-1]*i%mo;
    inv[N]=mul(fac[N],mo-2);
    for (int i=N-1;i>=0;i--) inv[i]=inv[i+1]*(i+1)%mo;
}
LL C(int x,int y) {
    if (y>x) return 0;
    return fac[x]*inv[y]%mo*inv[x-y]%mo;
}
int main() {
    pre();
    scanf("%d",&n);
    for (int i=0;i<n;i++)
	f[i]=C(n-i-2,i)*fac[n-1-i]%mo*fac[i]%mo;
    LL ans=0;
    for (int i=0;i<n;i++) {
	LL nowx=f[i]-f[i+1];
	ans=(ans+nowx*(n-i-1))%mo;
    }
    ans=(ans%mo+mo)%mo;
    printf("%lld\n",ans);
    return 0;
}
