def extgcd(a, b)
    if b == 0
        {x: 1, y: 0, gcd: a}
    else
        prev = extgcd(b, a % b)
        {
            x: prev[:y],
            y: prev[:x] - (a / b) * prev[:y],
            gcd: prev[:gcd]
        }
    end
end

def inv_mod(num)
    hash = extgcd(num, MOD)
    hash[:x] % MOD
end


N = gets.to_i
A = [0] + gets.split.map(&:to_i)
MOD = 10**9+7

invsum = [0]
(1..N).each do |i|
    invsum[i] = (invsum[i-1] + inv_mod(i)) % MOD
end

ans = 0
(1..N).each do |i|
    ans = (ans + A[i] * (invsum[i] + invsum[N+1-i] - 1)) % MOD
end

(2..N).each do |i|
    ans = ans * i % MOD
end
puts ans