from math import factorial print(factorial(int(input()))%1000000007)