function Main(s) {
  var n = s.split("\n")[0]*1;
  ans = 1;
  for (var i = 1; i <= n; i++) {
    ans = (ans * i) % 1000000007;
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));