import math N = int(input()) MOD = 10**12 if N < 50: print(math.factorial(N)%MOD) else: print(0)