#include<stdio.h>
int main()
{
    int n,i;
    long long int s;
    while(scanf("%d",&n)!=EOF)
    {
        s=1;
        for(i=2;i<=n;i++)
        {
            s*=i;
            s=s%1000000007;
        }
        printf("%lld\n",s);
    }
    return 0;
}
