class Integer def mod_inverse(mod) self.pow(mod - 2, mod) end end MOD = 10 ** 9 + 7 def mul(a, b) ret = Array.new(a.size) { Array.new(b[0].size, 0) } a.size.times do |i| b.size.times do |k| b[0].size.times do |j| ret[i][j] = (ret[i][j] + a[i][k] * b[k][j]) % MOD end end end ret end def pow(a, n) h = a.size w = a[0].size ret = Array.new(h) { Array.new(w, 0) } h.times do |i| ret[i][i] = 1 end while n > 0 ret = mul(ret, a) if n % 2 == 1 a = mul(a, a) n /= 2 end ret end N, M, K, P, Q = gets.split.map(&:to_i) B = N.times.map { gets.to_i } A = [ [Q - P, P], [P, Q - P], ] C = pow(A, K) m = Q.pow(K, MOD).mod_inverse(MOD) ans = 0 B.each.with_index(1) do |b, i| if i <= M ans += b * m * C[0][0] else ans += b * m * C[1][0] end ans %= MOD end puts ans