X = 1; for n in range( 1,int(input())+1 ): X = X * n % 1000000007 print(X)