def main(): n = int(input()) m = 10**9 + 7 if (n >= m): print(0) else: print(math.factorial(n)%m) if __name__ == "__main__": main()