#include #include using namespace std; int main() { const int p = 1000000007; int n; cin >> n; int s[100000]; s[0] = 1; for (int i = 2; i <= n; i++) { int sum = 0; if (i & 1 == 1) { for (int j = 1; j < i; j += 2) { sum += s[j]; } sum %= p; s[i - 1] = (i * sum) % p; } else { for (int j = 0; j < i; j += 2) { sum += s[j]; } sum %= p; s[i - 1] = (i * sum) % p; } } cout << s[n - 1] << "\n"; int a; cin >> a; }