#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef pair P; typedef pair PL; const ll mod = 1e9 + 7; int main() { ll n; cin >> n; if (n >= mod){ cout << 0 << endl; return 0; } ll ans = 1; FOR(i,2,n){ ans = (ans * i) % mod; } cout << ans << endl; return 0; }