import std.functional,
       std.algorithm,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

ulong M = 10UL^^9 + 7;

ulong fact(ulong n) {
  if (n <= 1) { return 1; }
  else {
    return n * fact(n - 1) % M;
  }
}

void main() {
  ulong n = readln.chomp.to!ulong;

  writeln(fact(n));
}
