import std.stdio, std.string, std.conv, std.range;

void main() {
  auto N = readln.chomp.to!int;
  ulong power = 1;
  foreach (i; iota(1, N + 1)) {
    power *= i;
    power %= 1000000007;
  }

  power.writeln;
}
