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