#include #include using namespace std; using ll = long long int; const ll MOD = 1'000'000'007; int main(){ int n; cin >> n; vector memo(n+10, 0), oddsum(n+10, 0), evensum(n+10, 0); memo[1] = 1; oddsum[1] = 1; for(int i = 2; i <= n; i++){ if(i % 2 == 0){ memo[i] = oddsum[i-1]*i; memo[i] %= MOD; evensum[i] = memo[i] + evensum[i-2]; evensum[i] %= MOD; }else{ memo[i] = evensum[i-1]*i; memo[i] %= MOD; oddsum[i] = memo[i] + oddsum[i-2]; oddsum[i] %= MOD; } } cout << memo[n] << endl; return 0; }