'use strict'

function main(input) {
  let x = 1;
  for (let = 0;i < input;i++) {
    x = x * i;
  }
  console.log(x % (1_000_000_000 + 7));
}

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