from collections import defaultdict

MOD = 10 ** 9 + 7





def main():

    N = int(eval(input()))

    ans = 1

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

        ans *= i

        ans %= MOD

    print((ans % MOD))





if __name__ == '__main__':

    main()

from collections import defaultdict



MOD = 10 ** 9 + 7





def main():

    N = int(eval(input()))

    ans = 1

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

        ans = (ans * i) % MOD

    print(ans)





if __name__ == '__main__':

    main()

from collections import defaultdict

MOD = 10**9 + 7


def main():
    N = int(eval(input()))
    ans = 1
    for i in range(1, N + 1):
        ans *= i
        ans %= MOD
    print((ans % MOD))


if __name__ == "__main__":
    main()

from collections import defaultdict

MOD = 10**9 + 7


def main():
    N = int(eval(input()))
    ans = 1
    for i in range(1, N + 1):
        ans = (ans * i) % MOD
    print(ans)


if __name__ == "__main__":
    main()

-        ans *= i -        ans %= MOD -    print((ans % MOD)) +        ans = (ans * i) % MOD +    print(ans)