#include <map>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f



int main()
{

	int i;
	std::ios::sync_with_stdio(false);
	long long x, n, m = pow(10, 9) + 7;
	while (cin >> n)
	{
		x = 1;
		for (i = 1; i <= n; i++)
		{
			x *= i;
			x = x%m;
		}
		cout << x << endl;
	}

	return 0;
}
