import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val div = 1000000007

  var tmp = 1L
  for (i in 1..n) {
    tmp *= i
    tmp %= div
  }

  println(tmp)
}
