n = int(input()) def frac(n,mod): a = 1 for i in range(2,n+1): a *= i a %= mod return a if n > 10**9 + 7: print(0) else: print(frac(n,10**9+7))