#include <iostream>

using namespace std;

const int mod =  1e9+7;
int main()
{
    long long n;
    long long s;
    while(cin>>n)
    {
        s = 1;
        for(int i = 1; i <= n; i++)
        {
            s = (s * i) % mod;
        }
        cout << s <<endl;
    }
    return 0;
}
