'use strict';
function Main(stdin){
  const N = Number(stdin.trim());
  let result = 1;
  for(let i = 1; i <= N; i++){
    result = result*i%1000000007;
  }
  console.log(result);
}

// 固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));