#include using namespace std; const unsigned long N = 1000000007; int main() { unsigned long x; cin >> x; unsigned long y = 1; for (unsigned long i = 1; i <= x; i++) { y = y * i % N; } cout << y << endl; return 0; }