object Main extends App {
  val inputs: Seq[String] = scala.io.Source.stdin.getLines().toList
  val i = inputs.head.toInt
  println(solve(i))

  private def solve(i: Int): Long = {
    ((1 to i).foldLeft(1L){ (acc, v) => 
        acc * v % 1000000007
    }).toLong
  }
}