#include <iostream>
using namespace std;
int main(){
	long long int n,a;
	cin >> n;
	a=1;
	for (int i=1;i<=n;i++){
		a*=i;
			a=a%(10*10*10*10*10*10*10*10*10+7);
		//cout<<a<<endl;
	}
	cout<<a;
	
	return 0;
}