#include <stdio.h>
#include <stdlib.h>

int main()
{
    __int64 s = 1;
    int i,x;
    scanf("%d",&x);
    for(i = 1;i <=x;i++)
    {
        s *=i;
        s %=1000000007;
    }
    printf("%I64d\n",s);
    return 0;
}
