# frozen_string_literal: true n = gets.chomp.to_i factorial = 1 n.times do |i| factorial *= (i + 1) factorial %= 10**9 + 7 end p factorial