import math n = int(input()) if n > 10**9 + 7: print(0) else: print(math.factorial(n)%(10**9 + 7))