"use strict";
    
const main = arg => {
    const N = arg.split("\n")[0]*1;
    // 階乗を出す
  	let x = factorial(N)%100000007;
  	console.log(x);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function factorial(num) {
  if (num === 1) {
    return 1;
  } else {
    return num * factorial(num - 1);
  }
};