/*

参考にした提出
https://agc023.contest.atcoder.jp/submissions/2435072

*/


#include<cstddef>
#include<cstdint>
#include<cstdio>

using uint64 = std::uint_fast64_t;

constexpr uint64 M = 1000000007;

template<std::size_t N>
struct Fact {
	uint64 val[N], v2[N];
	constexpr Fact() :val(), v2() {
		val[0] = 1;
		for (std::size_t i = 1; i < N; ++i) val[i] = val[i - 1] * i % M;
		for (std::size_t i = 1; i < N; ++i) v2[i] = val[i - 1] * val[i] % M;
	}
};

template<std::size_t N, uint64 F>
struct IFact {
	uint64 val[N];
	constexpr IFact() : val() {
		val[N - 1] = F;
		for (std::size_t i = N - 1; i; --i) val[i - 1] = val[i] * i % M;
	}
};

constexpr auto fact = Fact<1000000>();
constexpr auto ifact = IFact<1000000, 498215386>();

int main() {
	unsigned int n;
	uint64 ans=0;
	scanf("%u", &n);
	const std::size_t N = n;
	for (std::size_t i = (N + 1) >> 1; i < N - 1; ++i) {
		ans += fact.v2[i] * ifact.val[(i << 1) - N] % M;
	}
	ans = (fact.val[N - 1] * (N - 1) + M - ans) % M;
	printf("%llu\n", ans);
	return 0;
}
