#include #include #include #include #include using namespace std; long long mod = 1e9 + 7; long long sub = 1e8; long long fact[11] = { 1, 927880474, 933245637, 668123525, 429277690, 733333339, 724464507, 957939114, 203191898, 586445753, 698611116 }; void calc_mod_fact() { long long x = 1; cout << x << endl; for (int i = 1; i <= sub * 10; i++) { x = x * i % mod; if (i % sub == 0) { cout << x << endl; } } } int main() { // calc_mod_fact(); long long n; cin >> n; if (n >= mod) { cout << 0 << endl; return 0; } int idx = n / sub; long long x = fact[idx]; for (int i = 10 * idx + 1; i <= n; i++) { x = x * i % mod; } cout << x << endl; return 0; }