'use strict'

function main(s) {

  const N = Number(s);

  let mod = 1;
  let i = 1;

  while (i <= N) {
    mod = (mod * i) % 1000000007;
    i += 1;
  }

  console.log(mod);
}

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