import java.util.Scanner

fun main(args : Array<String>){
  val cin = Scanner(System.`in`)
  val n = cin.nextInt()
  var res = 1L
  for (i in 1..n){
    res = (res * i) % 1000000007
  }

  println(res)
}