#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){ if (a == 0){ return 1; }else if(a >= mod){ return 0; }else{ ll pre = 1; ll ret; for(ll i=1;i<=a;i++){ ret = (i * pre) % mod; pre = ret; } return ret; } }