
#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#define re register

#define il inline

#define ll long long

#define max(a,b) ((a)>(b)?(a):(b))

#define min(a,b) ((a)<(b)?(a):(b))

#define fp(i,a,b) for(re int i=a;i<=b;i++)

#define fq(i,a,b) for(re int i=a;i>=b;i--)

using namespace std;

const int mod=1e9+7,N=1e6+100;

ll n,x,jc[N],p,ans,Need,f[N],inv[N];

il ll gi()

{

  re ll x=0,t=1;

  re char ch=getchar();

  while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();

  if(ch=='-') t=-1,ch=getchar();

  while(ch>='0'&&ch<='9') x=x*10+ch-48,ch=getchar();

  return x*t;

}

il ll C(re ll x,re ll y)

{

  return jc[y]*inv[y-x]%mod*inv[x]%mod;

}

int main()

{

  n=gi();Need=(n+1)/2;

  jc[0]=inv[0]=inv[1]=1;

  fp(i,2,n) inv[i]=(mod-mod/i*inv[mod%i]%mod)%mod;//printf("%lld ",inv[i]);

  fp(i,1,n) jc[i]=jc[i-1]*i%mod;

  fp(i,2,n) inv[i]=inv[i]*inv[i-1]%mod;

  fp(i,Need,n-1) f[i]=C(n-i-1,i-1)*jc[i]%mod*jc[n-i-1]%mod;

  fq(i,n-1,Need) f[i]=(f[i]-f[i-1]+mod)%mod;

  fp(i,Need,n-1) (ans+=(f[i]*i%mod))%=mod;

  printf("%lld\n",ans);

  return 0;

}
