#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<queue>
#define INF 0x3f3f3f3f
#define MOD 1000000000+7
#define N 550
#define PI 3.1415927
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        long long fact=1;
        for(int i=1;i<=n;i++)
        {
            fact=fact*i;
            fact%=MOD;
        }
        fact%=MOD;
        cout<<fact<<endl;
    }
    return 0;
}
