#include <iostream>  
#include <cstdio>  
#include <cstring>  
#include <algorithm>  
#include <cmath>  
#include <string>  
#include <map>  
#include <stack>  
#include <vector>  
#include <set>  
#include <queue>  
#include <string>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <map>
#include <cctype>
#include <vector>
#include <cstdlib>
using namespace std;
long long mod = (long long)(1e9 + 7);
int main()
{
	long long  n;
	scanf("%lld", &n);
		long long sum = 1;
		for (int i = 2; i <= n; i++)
		{
			sum *= i;
			sum = sum%mod;
		}
		cout << sum%mod << '\n';
	return 0;
	
}