#include struct has_idplus_impl { template static auto check(T&& x)->decltype(x.idplus(),std::true_type{}); template static auto check(...)->std::false_type; }; template class has_idplus : public decltype(has_idplus_impl::check(std::declval())) {}; template struct Matrix{ using scalarvalue=T; private: std::vector> data; int col,row; public: constexpr Matrix(){} constexpr Matrix(std::vector> data):data(data){ col=data.size(); row=data[0].size(); } constexpr Matrix(int col,int row,scalarvalue init=0):row(row),col(col){ data.assign(col,std::vector(row,init)); } constexpr Matrix &operator+=(const Matrix rhs){ for(int i = 0; i < col; ++i){ for(int j = 0; j < row; ++j){ data[i][j]+=rhs[i][j]; } } } constexpr Matrix &operator-=(const Matrix rhs){ for(int i = 0; i < col; ++i){ for(int j = 0; j < row; ++j){ data[i][j]-=rhs[i][j]; } } } constexpr Matrix &operator*=(const scalarvalue rhs){//スカラー倍 for(int i = 0; i < col; ++i){ for(int j = 0; j < row; ++j){ data[i][j]*=rhs; } } } constexpr Matrix operator*(Matrix rhs){ Matrix ret(col,rhs.get_row(),0); for(int i = 0; i < col; ++i){ for(int j = 0; j < rhs.get_row(); ++j){ for(int k = 0; k < row; ++k){ ret[i][j]+=data[i][k]*rhs[k][j]; } } } return ret; } constexpr std::vector& operator[](const int i){ return data[i]; } constexpr Matrix pow(long long n){ assert(is_square());//正方形じゃないと計算が定義できない Matrix ret(col,row,0); Matrix a(*this); for(int i = 0; i < col; ++i){ ret[i][i]=1;//単位行列を作る } while(n>0){ if((n&1)!=0){//n%2==1 ret=ret*a; } a=a*a; n=n/2; } return ret; } bool is_square(){return col==row;} int get_col(){return col;} int get_row(){return row;} }; template struct ModInt{ using u64=uint64_t; private: u64 a; public: constexpr ModInt(){} constexpr ModInt(u64 x):a(x%Mod){} constexpr u64 &value(){return a;} constexpr const u64 &value()const{return a;} constexpr ModInt &operator+=(const ModInt rhs){ a+=rhs.value(); if(a>=Mod){ a-=Mod; } return *this; } constexpr ModInt &operator-=(const ModInt rhs){ if(a0){ if((n&1)!=0){//n%2==1 *this*=rhs; } rhs*=rhs; n=n/2; } return *this; } constexpr ModInt operator+(const ModInt rhs){ return ModInt(*this)+=rhs; } constexpr ModInt operator-(const ModInt rhs){ return ModInt(*this)-=rhs; } constexpr ModInt operator*(const ModInt rhs){ return ModInt(*this)*=rhs; } constexpr ModInt operator/(const ModInt rhs){ return ModInt(*this)/=rhs; } constexpr ModInt &operator++(){ ++a; if(a>=Mod){ a-=Mod; } return *this; } constexpr ModInt &operator--(){ if(a==0){ a+=Mod; } --a; return *this; } constexpr ModInt operator- (){ if(a==0)return 0; else return ModInt(Mod-a); } }; using Mi=ModInt<1000000007ull>; Mi operator"" _mi(unsigned long long n){ return Mi(n); } template T modinv(T a,T m=1000000007){ T b=m,u=1,v=0; while(b!=0){ T t=a/b; a-=t*b; std::swap(a,b); u-=t*v; std::swap(u,v); } u%=m; if(u<0)u+=m; return u; } long long mod=1000000007LL; template constexpr T modpow(T a,T n){//(a^n)%MOD T ret=1; while(n>0){ if((n&1)!=0){//n%2==1 ret=ret*a%mod; } a=a*a%mod; n=n/2; } return ret; } using namespace std; using ll=long long; int main(){ ll n,m,k,p,q; cin>>n>>m>>k>>p>>q; vector> op(2,vector(2)); op[0][0]=1_mi-Mi(p*modinv(q)); op[0][1]=Mi(p*modinv(q)); op[1][1]=1_mi-Mi(p*modinv(q)); op[1][0]=Mi(p*modinv(q)); Matrix mt(op); vector> a(1,{1_mi,0_mi}),b(1,{0_mi,1_mi}); Matrix ma(a),mb(b); mt=mt.pow(k); ma=ma*mt; mb=mb*mt; vector d(n); for (int i = 0; i < n; ++i) { ll t; cin>>t; d[i]=Mi(t); } Mi ans=0_mi; for (int i = 0; i < m; ++i) { ans+=d[i]*ma[0][0]; } for (int i = m; i < n; ++i) { ans+=d[i]*mb[0][0]; } cout<