"use strict";
    
const main = arg => {
    arg = arg.split("\n");
    const N = arg[0];
    
    let answer = 1;
    
    for(let i=2; i<=N; i++) {
        answer *= i;     
    }

    console.log(answer % (Math.pow(10, 9) + 7));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));