#include <bits/stdc++.h>

using namespace std;

const int N = 2000 * 1000 + 17;
const int MOD = 1000 * 1000 * 1000 + 7;

int n;
long long a[N], r[N], F[N], rF[N];

bool read() {
    if (!(cin >> n))
        return false;

    for (int i = 0; i < n; ++i)
        cin >> a[i];

    return true;
}

void solve() {
    F[0] = rF[0] = F[1] = rF[1] = r[1] = 1;

    for (int i = 2; i <= n; ++i) {
        r[i] = (MOD - (MOD / i) * r[MOD % i] % MOD) % MOD;
        F[i] = i * F[i - 1] % MOD;
        rF[i] = r[i] * rF[i - 1] % MOD;
    }

    auto ans = 0ll;

    for (int k = (n + 1) / 2; k < n; ++k)
        ans += F[k] * F[k - 1] % MOD * rF[2 * k - n] % MOD;

    cout << (MOD + F[n] - ans % MOD) % MOD << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    while (read())
        solve();

    return 0;
}

