'use strict'
 
function main(input) {
  let x = 1;
  const y = 1000000007
  input = input - 0
  for (let i = 1;i < input + 1;i++) {
    x = x * i;
    if (x > y) x = x % y;
  }
  console.log(x);
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));