#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
	long long n,m,a,b;
	long long sum;
	a=pow(10,9)+7;
	while(scanf("%lld",&n)==1)
	{
		sum=1;
		for(int i=1;i<=n;i++)
		{
			sum=sum*i;
		    sum=sum%a;
		}
		printf("%lld\n",sum);
	}
	return 0;
}