#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define fi first #define se second template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef long long ll; typedef pair pii; typedef pair pll; typedef pair pip; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; const bool debug = 0; //---------------------------------// ll dp[112345]; ll sum[112345][2]; // even, odd int main() { dp[1] = 1; sum[1][1] = 1; int n; cin >> n; FOR(i, 2, n + 1) { if (i & 1) dp[i] = i * sum[i - 1][0] % MOD; else dp[i] = i * sum[i - 1][1] % MOD; sum[i][0] = sum[i - 1][0]; sum[i][1] = sum[i - 1][1]; if (i & 1) sum[i][1] += dp[i]; else sum[i][0] += dp[i]; } cout << dp[n] << endl; return 0; }