"use strict";

var main = function main(input) {
  var N = parseInt(input, 10);
  var power = 1;

  while (N != 0) {
    power = power * N % 1000000007;
    N--;
  }

  console.log(power);
};

main(require('fs').readFileSync('/dev/stdin', 'utf-8'));