#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

int n;
ll MOD = 1e9+7;
ll num[1000100];
ll fac[1000100];
ll fnv[1000100];

ll power(ll a, ll n) {
    if (!n) return 1;
    ll t = power(a,n/2);
    return t*t%MOD*((n%2)?a:1)%MOD;
}

ll comb(ll n, ll k) {
    if (k<0||k>n) return 0;
    return fac[n]*fnv[k]%MOD*fnv[n-k]%MOD;
}

int main() {
    int i;

    scanf("%d",&n);
    fac[0] = 1;
    for (i=1;i<=n;i++) fac[i]=fac[i-1]*i%MOD;
    for (i=0;i<=n;i++) fnv[i]=power(fac[i],MOD-2);
    for (i=0;i<n;i++) num[i] = comb(i-1,2*i-n)*fac[n-1-i]%MOD*fac[i]%MOD;
    for (i=n-1;i>0;i--) num[i] = (num[i]+MOD-num[i-1])%MOD;
   // for (i=0;i<n;i++) printf("%d : %lld\n",i,num[i]);
    ll ans = 0;
    for (i=0;i<n;i++) ans = (ans+num[i]*i)%MOD;
    printf("%lld\n",ans);

    return 0;
}
