from math import factorial print(factorial(int(input()))%(pow(10,9)+7))