#include #include using namespace std; using ll = long long; int main(){ long long x; cin >> x; if(1e9 + 7 <= x){ cout << 0 << endl; return 0; } ll ans = 1e7 <= x ? 289849022 : 1; for(ll i = 1e7 <= x ? 1e7 + 1 : 2; i <= x; i++) (ans *= i) %= ll(1e9 + 7); cout << ans << endl; }