n = int(eval(input()))

ans = 1

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

    ans *= i

    ans %= 10**9 + 7

print(ans)
from functools import reduce
def main():

    from functools import reduce



    MOD = 10 ** 9 + 7



    def mod_mul(a, b):

        return a * b % MOD



    N = int(eval(input()))

    ans = reduce(mod_mul, list(range(1, N + 1)))

    print(ans)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

n = int(eval(input()))
ans = 1
for i in range(1, n + 1):
    ans *= i
    ans %= 10**9 + 7
print(ans)

from functools import reduce


def main():
    from functools import reduce

    MOD = 10**9 + 7

    def mod_mul(a, b):
        return a * b % MOD

    N = int(eval(input()))
    ans = reduce(mod_mul, list(range(1, N + 1)))
    print(ans)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

-n = int(eval(input())) -ans = 1 -for i in range(1, n + 1): -    ans *= i -    ans %= 10**9 + 7 -print(ans) +from functools import reduce + + +def main(): +    from functools import reduce + +    MOD = 10**9 + 7 + +    def mod_mul(a, b): +        return a * b % MOD + +    N = int(eval(input())) +    ans = reduce(mod_mul, list(range(1, N + 1))) +    print(ans) + + +if __name__ == "__main__": +    main() +# import sys +# +# sys.setrecursionlimit(10 ** 7) +# +# input = sys.stdin.readline +# rstrip() +# int(input()) +# map(int, input().split())