n=int(input()) if n<1000000007: x=1 for i in range(2,n+1): x*=i x%=1000000007 else: x=0 print(x)