#include using namespace std; // clang-format off struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast; // clang-format on #define int long long const int MOD = 1000000007; const int MODSplit = 100000000; signed main() { int N; cin >> N; if (N >= MOD){ cout << 0 << '\n'; } else { vector A_list = {1, 15000001, 960000008, 835000008, 640000008,375000008, 40000008, 635000015, 160000015, 615000022, 22}; int tmp = A_list[N / MODSplit]; if (N != 0){ int start = N - (N % MODSplit) + 1; for (int i = start; i <= N; i++) { tmp = (tmp * i) % MOD; } } cout << tmp << '\n'; } return 0; }