## ABC 055B



d = 1000000007

n = int(eval(input()))

ans = 1

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

    ans = (ans*i)%d



print(ans)
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10000000)



MOD = 1000000007  # type: int





def solve(N: int):

    ans = 1

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

        ans = (ans * i) % MOD



    print(ans)



    return





# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    solve(N)



if __name__ == '__main__':

    main()

## ABC 055B
d = 1000000007
n = int(eval(input()))
ans = 1
for i in range(1, n + 1):
    ans = (ans * i) % d
print(ans)

#!/usr/bin/env python3
import sys

sys.setrecursionlimit(10000000)
MOD = 1000000007  # type: int


def solve(N: int):
    ans = 1
    for i in range(1, N + 1):
        ans = (ans * i) % MOD
    print(ans)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

-## ABC 055B -d = 1000000007 -n = int(eval(input())) -ans = 1 -for i in range(1, n + 1): -    ans = (ans * i) % d -print(ans) +#!/usr/bin/env python3 +import sys + +sys.setrecursionlimit(10000000) +MOD = 1000000007  # type: int + + +def solve(N: int): +    ans = 1 +    for i in range(1, N + 1): +        ans = (ans * i) % MOD +    print(ans) +    return + + +# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) +def main(): +    def iterate_tokens(): +        for line in sys.stdin: +            for word in line.split(): +                yield word + +    tokens = iterate_tokens() +    N = int(next(tokens))  # type: int +    solve(N) + + +if __name__ == "__main__": +    main()