object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()

  val mod = 1000000007

  def times(a: Long, b: Long): Long = (a * b) % mod

  val ans = (1 to n).map(_.toLong).reduceLeft(times)
  println(ans)
}
