import math def main(): n = int(input()) ans = math.factorial(n) % 1000000007 print(ans) main()