import sys input = sys.stdin.readline n, m, k, p, q = map(int, input().split()) l = [int(input()) for _ in range(n)] s0 = 0 s1 = 0 for i in range(n): if i <= m-1: s0 += l[i] else: s1 += l[i] def power_func(a,n,p): bi=str(format(n,"b"))#2進表現に res=1 for i in range(len(bi)): res=(res*res) %p if bi[i]=="1": res=(res*a) %p return res mod = 10**9+7 x = (power_func(q,k,mod) + power_func(q-2*p,k,mod))*s0 + (power_func(q,k,mod) - power_func(q-2*p,k,mod))*s1 #x = (q**k+(q-2*p)**k)*s0 + (q**k-(q-2*p)**k)*s1 y = 2*power_func(q,k,mod) #y = 2*q**k mod = 10**9+7 #print(x/y) print(x*pow(y,(mod-2),mod)%mod)