#include<stdio.h>
#include<string.h>
#define maxn 1000000007
main()
{
    int i,j;
    __int64 n,s;
    while(scanf("%I64d",&n)!=EOF)
    {s=1;
    for(i=1;i<=n;i++)
        {s=s*i;
        s=s%maxn;
       }
    printf("%I64d\n",s%maxn);
    }
}
