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