N=int(input()) P=1 for i in range(N): P=P*(i+1) if P >10**9+7: P=P%(10**9+7) print(P)