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