n = gets.to_i
MOD = 10**9 + 7

def get_c(n)
  return 0 if n == 1
  return n if n == 2

  n = n * (n - 1)
  puts n
  return (n * 0.5)
end

c = get_c(n)

if n <= 1
  puts 0
else
  puts 10 ** (n - 2) * c % MOD
end
