#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { int N; cin >> N; long long a[2]; a[0] = 0; a[1] = 1; for ( int i = 2; i < N; i++ ) { a[i%2] += (i*a[1-(i%2)])%MOD; a[i%2] %= MOD; } if ( N == 1 ) { cout << 1 << endl; } else { cout << (N*a[1-(N%2)])%MOD << endl; } return 0; }