'use strict'

function main(input) {
  input = Number(input)
  const divider = 1000000007

  let power = 1
  for (let i=1; i<=input; i++) {
    power = (power * i) % divider
  }

  console.log(power)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));