#include using namespace std; typedef long long ll; const int mod = 1e9+7; class mint { public: ll x; mint(ll x = 0) : x((x % mod + mod) % mod) {} ll get() const { return x; } mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { return mint(*this) += a; } mint operator-(const mint a) const { return mint(*this) -= a; } mint operator*(const mint a) const { return mint(*this) *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t>>1); return (t & 1) ? a*a*(*this) : a*a; } operator ll () const { return x; } operator string () const { return to_string(x); } // for prime mod mint inv() const { return pow(mod-2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { return mint(*this) /= a; } }; template class Matrix { public: int r, c; vector> A; Matrix(int r, int c): r(r), c(c) { A.resize(r); for (int i=0; i &operator[](int i) const { return (A.at(i)); } vector &operator[](int i) { return (A.at(i)); } Matrix &operator+=(const Matrix &B) { for (int i=0; i> t(r, vector(B.c, 0)); for (int i=0; i>=1) { if (k & 1) t *= (*this); (*this) *= (*this); } swap(A, t.A); return (*this); } }; int main() { int N, M; ll K, _p, _q; cin >> N >> M >> K >> _p >> _q; mint p(_p), q(_q); Matrix B(N+1, 1); ll b; for (int i=1; i<=N; ++i) { cin >> b; B[i][0] = b; } Matrix A(1, N+1); for (int i=0; i<=M; ++i) A[0][i] = 1; Matrix C(N+1, N+1); C[0][0] = 1; for (int i=1; i<=N; ++i) { C[0][i] = p/q; C[i][i] = (q - mint(2) * p) / q; } C ^= K; (A *= C) *= B; cout << A[0][0] << endl; return 0; }