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