function Main(inp) {
    var input = inp.split('\n')[0].split(' ').map(function(n) {
        return Number(n);
    });
    var n = input[0];
    var power = 1;
    for(var i = 1; i <= n; i++) {
      power = i * power % (Math.pow(10, 9) + 7); 
    }
    console.log(power);
}

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