#include using namespace std; #define FOR(i, n) for(int i = 0; i < (n); i++) #define MEM(a, x) memset(a, x, sizeof(a)) #define ALL(a) a.begin(), a.end() #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) typedef long long ll; int n; ll MOD = 1000000007; ll a[100005]; int main(int argc, char const *argv[]) { ios_base::sync_with_stdio(false); cin >> n; ll s1 = 1, s2 = 0; a[1] = 1; for (int i = 2; i <= n; i++) { if (i & 1) { a[i] = i * s2 % MOD; s1 = (s1 + a[i]) % MOD; } else { a[i] = i * s1 % MOD; s2 = (s2 + a[i]) % MOD; } } cout << a[n] << endl; return 0; }