#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,927880474,933245637,668123525,429277690,733333339,724464507,957939114,203191898,586445753,698611116}; int tmp = A_list[N / MODSplit]; if (N % MODSplit != 0){ int start = N - (N % MODSplit) + 1; for (int i = start; i <= N; i++) { tmp = (tmp * i) % MOD; } } cout << tmp << '\n'; } }