defmodule Main do
  def main do
    n = IO.gets("")
      |> String.trim()
      |> String.to_integer()
      |> process(1)
      |> IO.puts()
  end
  
  defp process(0, acc), do: rem(acc,1000000007)
  defp process(n, acc), do: process(n - 1, rem(acc,1000000007) * n)
end