fun main(args: Array<String>) {
    val mod = 1000000007L
    val N = readInputLine().toInt()
    var ans = 1L
    
    for (i in 1..N) {
        ans *= i
        ans %= mod
    }
    
    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}
