#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{long long n,i,sum;
 while(~scanf("%I64d",&n))
 {sum=1;
  for(i=2;i<=n;i++)
  sum=(sum*i)%(10*10*10*10*10*10*10*10*10+7);
  printf("%I64d\n",sum%(10*10*10*10*10*10*10*10*10+7));
 }
 return 0;
}