#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) #define CLR(mat) memset(mat, 0, sizeof(mat)) typedef long long ll; const ll mod = 1e9 + 7; int main() { int n; cin >> n; int oddsum = 1, evensum = 0; ll a = 1; FOR(i,2,n+1) { if(i % 2 == 0) { a = i * oddsum; a %= mod; evensum += a; } else { a = i * evensum; a %= mod; oddsum += a; } } cout << a % mod << endl; return 0; }