Module Module1

    Sub Main()

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

        Dim nPower As Double
        nPower = 1

        Dim nDivider As Double
        nDivider = 10.0 ^ 9.0 + 7.0

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


        Console.WriteLine(CLng(nPower))

    End Sub

End Module
