Module Module1

    Sub Main()

        Dim nN As Integer
        nN = CInt(Console.ReadLine())

        Dim nPower As Long
        nPower = 1

        Dim nDivider As Integer
        nDivider = 10 ^ 9 + 7

        Dim ii As Integer
        For ii = 1 To nN
            nPower = (nPower * ii) Mod nDivider
        Next


        Console.WriteLine(nPower)

    End Sub

End Module
