#include #define ll long long using namespace std; ll mod = 1000000007; ll makeFactrial(ll a); int main(){ ll N; cin >>N; cout << makeFactrial(N) << endl; return 0; } ll makeFactrial(ll a){ ll pre = 1; ll ret; for(ll i=1;i<=a;i++){ ret = (i * pre) % mod; pre = ret; } return ret; }