#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
  long long m,s,n,i;
  m=pow(10,9)+7;
  while(~scanf("%ld",&n))
  {
      s=1;
      for(i=1;i<=n;i++)
      {
          s*=i;
          s%=m;
      }
      printf("%ld\n",s);
  }
}