#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <math.h>
#include <map>
#include <set>
#define sc scanf
#define pr printf
using namespace std;
typedef long long ll;
const ll N = 1000000000+7;
int main()
{
    int n;
    while(~sc("%d",&n))
    {
        ll ans = 1;
        for(int i=1; i<=n; i++)
        {
            ans = ((ans)%N)*((i)%N)%N;
        }
        cout<<ans<<endl;
    }
    return 0;
}
