#include using namespace std; const int MOD = int(1e9) + 7; int main() { ios::sync_with_stdio(false); int n; cin >> n; int odd = 1, even = 0; int a, b; for (int i = 2; i <= n; ++i) { if (i & 1) { a = 1LL * i * even % MOD; odd = (odd + a) % MOD; } else { b = 1LL * i * odd % MOD; even = (even + b) % MOD; } } if (n & 1) cout << a << endl; else cout << b << endl; return 0; }