fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextLong()

    val m = Math.pow(10.0, 9.0).toLong() + 7L

    var ans = 1L
    for (i in 1..n) {
        ans = (ans * i % m)
    }

    println(ans)
}
