#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void)
{
	int mod = 1e9+7;
	int n;
	scanf("%d", &n);
	long long s = 1;
	for (int i = 1; i <= n; i++)
	{
		s = ((s%mod)*(i%mod))%mod;
	}
	printf("%lld\n",s);
	return 0;
}