function Main(input) {
    var power = 1;
    for (var i = 1; i < input; i++) {
        power = power * i;
    }
    console.log(power % (Math.pow(10, 9) + 7));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));