#include "bits/stdc++.h"
#define ff first
#define ss second
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const ll INFL = 1e18 + 123;
const double PI = atan2(0, -1);
mt19937 tw(960172);
ll rnd(ll x, ll y) { static uniform_int_distribution<ll> d; return d(tw) % (y - x + 1) + x; }

//#define USE_ASM_MULTIPLICATION

template<int prime, int phi>
struct mod_int {
	static int const modulo = prime;
	static int const phi_modulo = phi;

	unsigned int by_modulo(unsigned long long num) const {
		#ifdef USE_ASM_MULTIPLICATION
		    unsigned long long x = num;
		    unsigned int xh = x >> 32, xl = x, q, r;
			#ifdef __GNUC__
			    asm(
			        "divl %4; \n\t"
			        : "=a" (q), "=d" (r)
			        : "d" (xh), "a" (xl), "r" (modulo)
			    );
			#else
			    __asm {
			        mov edx, dword ptr[xh];
			        mov eax, dword ptr[xl];
			        div dword ptr[mod];
			        mov dword ptr[q], eax;
			        mov dword ptr[r], edx;
			    };
			#endif
		    return r;
		#else
		    return num % modulo;
		#endif
	}


	mod_int(int _value) : value(_value), inv_(-1) {
		if (value < 0 || value >= modulo) {
			value %= modulo;
			if (value < 0) {
				value += modulo;
			}
		}
	}

	mod_int(long long _value) : value(_value % prime), inv_(-1) {
		if (value < 0) {
			value += modulo;
		}
	}

	mod_int() : value(0), inv_(-1) {}

	mod_int<prime, phi>& operator+=(mod_int<prime, phi> const& a) {
		value += a.value;
		if (value >= prime) {
			value -= prime;
		}
		inv_ = -1;
		return *this;
	}

	mod_int<prime, phi>& operator-=(mod_int<prime, phi> const& a) {
		value -= a.value;
		if (value < 0) {
			value += prime;
		}
		inv_ = -1;
		return *this;
	}

	mod_int<prime, phi>& operator*=(mod_int<prime, phi> const& a) {
		value = by_modulo((long long) value * a.value);
		if (inv_ != -1 && a.inv_ != -1) {
			inv_ = by_modulo((long long) inv_ * a.inv_);
		} else {
			inv_ = -1;
		}
		return *this;
	}

	mod_int<prime, phi> &operator/=(mod_int<prime, phi> a) {
		assert(a.value != 0);
		value = by_modulo((long long) value * a.inv().value);
		if (inv_ != -1) {
			inv_ = by_modulo((long long) inv_ * a.value);
		}
		return *this;
	}

	mod_int<prime, phi> inv() const {
		assert(value != 0);
		if (inv_ == -1 && value != 0) {
			inv_ = pow(phi - 1).value;
		}
		return inv_;
	}

	mod_int<prime, phi> pow(int p) const {
		int res = 1;
		int a = value;
		while (p) {
			if (p & 1) {
				res = by_modulo((long long) res * a);
			}
			a = by_modulo((long long) a * a);
			p >>= 1;
		}
		return res;
	}

	mod_int<prime, phi> pow(long long p) const {
		if (phi + 1 == prime && p > phi_modulo) {
			p %= phi_modulo;
		}
		int res = 1;
		int a = value;
		while (p) {
			if (p & 1) {
				res = by_modulo((long long) res * a);
			}
			a = by_modulo((long long) a * a);
			p >>= 1;
		}
		return res;
	}

	explicit operator int() const {
		return value;
	}

	int value;
	mutable int inv_;
};

template<int p, int q> mod_int<p, q> operator+(mod_int<p, q> a, auto const& b) { return a += b; }
template<int p, int q> mod_int<p, q> operator-(mod_int<p, q> a, auto const& b) { return a -= b; }
template<int p, int q> mod_int<p, q> operator*(mod_int<p, q> a, auto const& b) { return a *= b; }
template<int p, int q> mod_int<p, q> operator/(mod_int<p, q> a, auto const& b) { return a /= b; }
template<int p, int q> bool operator==(mod_int<p, q> const& a, auto const& b) { return a.value == b.value; };
template<int p, int q> bool operator!=(mod_int<p, q> const& a, auto const& b) { return a.value != b.value; };
template<int p, int q> ostream &operator<<(ostream &os, mod_int<p, q> const& m) { return os << m.value; }
template<int p, int q> istream &operator>>(istream &is, mod_int<p, q>& m) { 
	long long tmp;
	is >> tmp;
	m = mod_int<p, q>(tmp);
	return is; 
}

const int MOD = 1000000007;
typedef mod_int<MOD, MOD - 1> mint;

vector<mint> factorial;

mint cnk(int n, int k) {
	return factorial[n] / factorial[k] / factorial[n - k];
}

void solve() {
	int n;
	cin >> n;

	factorial = {1};

	for (int i = 1; i < n + 10; ++i) {
		factorial.push_back(factorial.back() * i);
	}

	mint ans = 0;
	mint prev = 0;
	for (int i = 1; i <= n; ++i) {
		if (0 <= n - 1 - i && n - i - 1 <= i - 1) {
			mint cur = cnk(n - 1 - (n - 1 - i) - 1, n - 1 - i) * factorial[i] * factorial[n - 1 - i];
			ans += (cur - prev) * i;
			prev = cur;
		}
	}

	cout << ans << "\n";
}


int main() {
	//freopen(TASK_NAME ".in", "r", stdin);
	//freopen(TASK_NAME ".out", "w", stdout);
	cerr << fixed << setprecision(15);
	cout << fixed << setprecision(15);
	ios::sync_with_stdio(false);

	int tests = 1;
	// cin >> tests;
	for (int it = 1; it <= tests; ++it) {
		solve();
	}
	
	#ifdef LOCAL
		cerr << "time: " << clock() << " ms\n";
	#endif
	return 0;
}

Measured memory_bytes: 10220