#include<iostream>
#include<cstdio>
using namespace std;
long long x,y;
long long jc[100010],f[100010];
long long gcd(long long a,long long b)
{
if(b==0)
{
x=1;
y=0;
return a;
}
long long r=gcd(b,a%b);
long long t=x-a/b*y;
x=y;
y=t;
return r;
}
int main()
{
freopen("xvii.in","r",stdin);
freopen("xvii.out","w",stdout);
long long n;
scanf("%lld",&n);
jc[1]=1;
long long s=2;
for(int i=2;i<=n;i++)
{
f[i]=f[i-1]*i+(s-1)*jc[i-1];
f[i]%=1000000007;
s*=2;
s%=1000000007;
jc[i]=jc[i-1]*i;
jc[i]%=1000000007;
}
long long o=gcd(jc[n],1000000007);
while(x<=0)
x+=1000000007;
x*=f[n];
printf("%lld",x%1000000007);
getchar();
getchar();
}