fun main(args: Array<String>) = yorukatsu14b()

fun yorukatsu14b() {
    val n = readLine()!!.toLong()

    val answer = (1..n).fold(1L) { acc, l -> (acc * l) % MOD }

    println(answer)
}

private const val MOD = (1e9 + 7).toLong()
