#include <bits/stdc++.h>

using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

const int N = 2000005, MOD = 1000000007;
int f[N], finv[N], act[N];

int mul(int a, int b) {
    return (ll)a * b % MOD;
}

void precalc() {
    f[0] = 1;
    for (int i = 1; i < N; i++) {
        f[i] = mul(f[i - 1], i);
    }
    finv[0] = finv[1] = 1;
    for (int i = 2; i < N; i++) {
        finv[i] = (MOD - mul(MOD / i, finv[MOD % i])) % MOD;
    }
    for (int i = 2; i < N; i++) {
        finv[i] = mul(finv[i - 1], finv[i]);
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.setf(cout.fixed);
    cout.precision(20);
    precalc();
    int n;
    cin >> n;
    for (int k = (n + 1) / 2; k < n; k++) {
        act[k] = mul(mul(f[k - 1], f[k]), finv[2 * k - n]);
    }
    ll res = 0;
    for (int k = (n + 1) / 2; k < n; k++) {
        res = (res + mul(k, MOD + act[k] - act[k - 1])) % MOD;
    }
    cout << res << "\n";
}
