N = gets.chomp.to_i
X = gets.chomp.split(" ").map(&:to_i)

a = X.map {|n| X.last - n}
pa = a[1..-2]

sum = 0
total = 0
(0..pa.size).each do |n|
  pa.combination(n).each do |l|
    total += 1
    if l.empty? then
      sum += a.first
      next
    end
    sum += a.first + l.inject(:+)
  end
end

avg = sum / total.to_f

d = 10 ** 9 + 7
(1..N-1).each do |n|
  avg *= n
  avg = avg % d
end

puts avg.to_i