import sys

from math import factorial



MOD = 10**9 + 7



def solve():

    N = int(input())

    ans = factorial(N) % MOD

    print(ans)

    

def debug(x, table):

    for name, val in table.items():

        if x is val:

            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)

            return None





if __name__ == '__main__':

    solve()

N = int(eval(input()))



ans = 1

mod = 10**9 + 7



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

    ans = (ans * i) % mod



print(ans)
import sys
from math import factorial

MOD = 10**9 + 7


def solve():
    N = int(input())
    ans = factorial(N) % MOD
    print(ans)


def debug(x, table):
    for name, val in table.items():
        if x is val:
            print("DEBUG:{} -> {}".format(name, val), file=sys.stderr)
            return None


if __name__ == "__main__":
    solve()

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

-import sys -from math import factorial - -MOD = 10**9 + 7 - - -def solve(): -    N = int(input()) -    ans = factorial(N) % MOD -    print(ans) - - -def debug(x, table): -    for name, val in table.items(): -        if x is val: -            print("DEBUG:{} -> {}".format(name, val), file=sys.stderr) -            return None - - -if __name__ == "__main__": -    solve() +N = int(eval(input())) +ans = 1 +mod = 10**9 + 7 +for i in range(1, N + 1): +    ans = (ans * i) % mod +print(ans)