fun main(args: Array<String>) {
    val num = readLine()!!.trim().toInt()
    var power: Long = 1L
    val hou: Long = 1000000000L + 7

    (1..num).forEach {cur ->
        power = power * cur % hou
    }

    println(power)
}