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