#include <iostream>

using namespace std;

const int mod =  1e9+7;

int main()
{
    long long n;
    long long s[100001];
    s[1] = 1;
    for(int i = 2; i <= 100000; i++)
        s[i] = (s[i-1]%mod * i%mod) % mod;
    while(cin>>n)
    {
        cout<< s[n] << endl;
    }
    return 0;
}
