import math





def main():

    N = int(eval(input()))

    power = math.factorial(N)

    print((power % (10 ** 9 + 7)))





if __name__ == "__main__":

    main()

def main():

    N = int(eval(input()))

    power = 1

    for i in range(1, N + 1):

        power *= i

        power %= 10 ** 9 + 7

    print(power)





if __name__ == "__main__":

    main()

import math


def main():
    N = int(eval(input()))
    power = math.factorial(N)
    print((power % (10**9 + 7)))


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    power = 1
    for i in range(1, N + 1):
        power *= i
        power %= 10**9 + 7
    print(power)


if __name__ == "__main__":
    main()

-import math - - -    power = math.factorial(N) -    print((power % (10**9 + 7))) +    power = 1 +    for i in range(1, N + 1): +        power *= i +        power %= 10**9 + 7 +    print(power)