object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN) = readLine.split(" ").map(_.toLong)
    val divBase = 1000000000L + 7L

    var power: Long = 1

    (1L to datN).foreach { a =>
      power = (power * a) % divBase
    }

    val ans = power
    println(power)
  }
}
