import java.util.Scanner;

fun main (args : Array<String>) {
  val MOD = 1_000_000_007L
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    var power = 1L
    
    for (i in 1..N) {
      power *= i
      power %= MOD
    }
    
    println(power)
  }
}