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