#include<bits/stdc++.h>
#define maxn 1000050
#define F first
#define S second
#define M 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
ll f[maxn],n,fc[maxn],fi[maxn],ans,s;
ll dp[105][105];

ll pow_(ll x,ll y){ll rt=1; while (y){if (y&1) rt=rt*x%M; x=x*x%M; y/=2;} return rt;}

ll c(ll x,ll y){if (x<y) return 0; else return fc[x]*fi[y]%M*fi[x-y]%M;}

int main()
{
    cin >> n;
    fc[0]=fc[1]=1; for (int i=2;i<=n;i++) fc[i]=fc[i-1]*i%M;
    fi[0]=fi[1]=1; for (int i=2;i<=n;i++) fi[i]=pow_(fc[i],M-2);
    ans=(n-1)*fc[n-1]%M;
    n--;
    for (int i=n/2+1;i<n;i++)
    {
        (s+=c(i-1,n-i)*fc[i]%M*fc[n-i]%M)%=M;
        //cout << i << ' ' << s << endl;
    }
    ans=(ans-s+M)%M;
    cout << ans << endl;
}
