fun main(args: Array<String>) {
    val (n) = readLine()!!.split(' ').map(String::toInt)
    var ret = 1L
    for(i in 1..n){
        ret *= i.toLong()
        ret %= 1e9.toLong() + 7
    }
    print(ret)
}