fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val key = Math.pow(10.0, 9.0) + 7
    var power = 1.0
    for (i in 1..n) {
        power = (power * i) % key
    }
    print(power.toInt())
}