#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll N=1e9+7;
int main()
{
    ll n;
    while(cin>>n)
    {
        ll sum=1;
        for(ll i=1;i<=n;i++)
        {
            sum*=i;
            sum%=N;
        }
        cout<<sum;
    }
}