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