#include using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define INF (1 << 30) #define fi first #define se second typedef long long ll; typedef unsigned long long ull; typedef pair P; typedef pair Pi; typedef pair PP; const int MOD = 1e9 + 7; const int dy[]={0, 0, 1, -1}; const int dx[]={1, -1, 0, 0}; template void chmin(T& a, const T& b) { a = min(a, b); } template void chmax(T& a, const T& b) { a = max(a, b); } ll n, a[100001]; signed main() { cin.tie(0); ios::sync_with_stdio(false); cin >> n; a[1] = 1; ll even = 0, odd = 1; FOR(i, 2, n + 1) { if(i % 2) { a[i] = i * even % MOD; odd = (odd + a[i]) % MOD; } else { a[i] = i * odd % MOD; even = (even + a[i]) % MOD; } } cout << a[n] << endl; return 0; }