x = int(input()) z = 1 for i in range(x): z = z * (i + 1) ans = z % 1000000007 print(ans)