import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

// ----- library mod -----

const ulong mod = 1_000_000_007;
	// assert(mod % 2 > 0);
	// for(int i = 3; i * i <= x; i += 2) assert(x % i > 0);
	// assert(mod * mod < ulong.max);
	
const int nmax = 1_000_000;
		
ulong sum(ulong[] xs ...){
	ulong ans = 0;
	foreach(x; xs){
		ans += x;
		ans %= mod;
		}
	return ans;
	}

ulong diff(ulong x, ulong y){
	return sum(x, neg(y));
	}

ulong neg(ulong x){
	assert(x < mod);
	return (mod - x) % mod;
	}

ulong prod(ulong[] xs ...){
	ulong ans = 1;
	foreach(x; xs){
		ans *= x;
		ans %= mod;
		}
	return ans;
	}

ulong quot(ulong x, ulong y){
	assert(y > 0);
	assert(y < nmax);
	return prod(x, inv(y));
	}

ulong inv(ulong x){
	assert(x > 0);
	assert(x < nmax);
	static bool inited = false;
	static ulong[nmax] _inv;
	if(!inited){
		_inv[1] = 1;
		foreach(i; 2 .. nmax){
			_inv[i] = (mod - mod / i) * _inv[mod % i] % mod;
			}
		inited = true;
		}
	return _inv[cast(int) x];
	}

ulong frac(ulong x){
	assert(x < nmax);
	static bool inited = false;
	static ulong[nmax] _frac;
	if(!inited){
		_frac[0] = 1;
		foreach(i; 1 .. nmax){
			_frac[i] = _frac[i - 1] * i % mod;
			}
		inited = true;
		}
	return _frac[cast(int) x];
	}

ulong invfrac(ulong x){
	assert(x < nmax);
	static bool inited = false;
	static ulong[nmax] _invfrac;
	if(!inited){
		_invfrac[0] = 1;
		foreach(i; 1 .. nmax){
			_invfrac[i] = _invfrac[i - 1] * inv(i) % mod;
			}
		inited = true;
		}
	return _invfrac[cast(int) x];
	}

ulong binom(ulong n, ulong k){
	assert(n < nmax);
	assert(k <= n);
	return prod(frac(n), invfrac(k), invfrac(n - k));
	}

// ----- library mod end -----




const DEBUG = 0;


void main(){
	int n = read.to!int;
	
	long[nmax] ys;
	long[nmax] xs;
	
	foreach(k; 0 .. (n + 1) / 2){
		ys[k] = 0;
		}
	foreach(k; (n + 1) / 2 .. n + 1){
		ys[k] = binom(k - 1, 2 * k - n) * frac(k);
		ys[k] %= mod;
		}
	
	foreach(k; 0 .. (n + 1) / 2){
		xs[k] = 0;
		}
	foreach(k; (n + 1) / 2 .. n + 1){
		xs[k] = ys[k];
		xs[k] += neg(prod(ys[k - 1] * (n - k)));
		xs[k] %= mod;
		}
	
	if(DEBUG) ys[0 .. n + 1].writeln;
	if(DEBUG) xs[0 .. n + 1].writeln;
	
	long sum = 0;
	foreach(k; 0 .. n){
		sum += prod(xs[k], k);
		sum %= mod;
		}
	
	sum.writeln;
	}