#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>

using namespace std;
int gcd(int a, int b)
{
    return b?gcd(b, a%b):a;
}
const int mod = 1e9+7;
int main()
{
    int n;
    while(~scanf("%d", &n))
    {
        long long ans = 1;
        for(int i = 1;i <= n;i++)
            ans *= i, ans %= mod;
        printf("%lld\n", ans);
    }
    return 0;
}
