DIVISOR = 10**9+7 def fact_(n) (1..n).inject{|r, n| r * n % DIVISOR} end N = gets.to_i puts fact_(N)