n = int(input()) if n >= 50: print(0) else: mod = 10 ** 12 result = 1 for i in range(2, n + 1): result = (result * i) % mod print(result)