Imports System

Public Class Program

    Public Shared Sub Main(args As String())
        Dim N As Integer = Integer.Parse(Console.ReadLine)

        Dim p As ULong = 1

        For i As Integer = 1 To N
            p = p * i
            p = p Mod 1000000007
        Next

        Console.WriteLine(p)

    End Sub
End Class