#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxN = 1e6 + 5;
const int mod = 1e9 + 7;
ll frac[maxN];
ll inv[maxN];
ll f[maxN];
ll pw(ll a, ll b) {
    ll ans = 1;
    while (b) {
        if (b&1) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans;
}
void init() {
    frac[0]= 1;
    inv[0] = 1;
    for (int i = 1; i <= maxN; i++) {
        frac[i] = frac[i-1] * i % mod;
        inv[i] = pw(frac[i], mod-2);
    }
}
ll c(ll m, ll n) {
    if (m < n) return 0;
    if (n == 0) return 1;
    return frac[m] * inv[n] % mod * inv[m-n] % mod;
}
int main() {
    int n;
    cin >> n;
    init();
    f[2] = 1;
    ll ans = 0;
    for (ll i = n/2; i < n; i++) {
        f[i] = c(i-1, n-1-i) * frac[i] % mod * frac[n-1-i] % mod;
        //cout << f[i] << "\n";
        ans = (ans + (f[i] - f[i-1] + mod) % mod * i) % mod;
    }
    cout << ans << "\n";
    return 0;
}
