#include using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { int N; cin >> N; vector a(N + 1); int odd = 1, even = 0; a[1] = 1; for (int i = 2; i <= N; i++) { if (i % 2) a[i] = (ll)i * even % MOD, odd = (odd + a[i]) % MOD; else a[i] = (ll)i * odd % MOD, even = (even + a[i]) % MOD; } cout << a[N] << endl; }