import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val res = factorial(n, 1000000007)

  println(res)

  def factorial(n: Int, mod: Int): Long ={
    (1 to n).foldLeft(1L){(fact, k) =>

      fact * k % mod
    }
  }
}
