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