#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rrep(i, n) for(ll i = (ll)(n-1); i >= 0; i--) #define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rrepi(i,a,b) for(ll i=(ll)(b-1);i>=(ll)(a);i--) #define all(x) (x).begin(),(x).end() templateinline bool chmax(T &a, const T &b) { if (ainline bool chmin(T &a, const T &b) { if (b class modint { using u64 = std::uint_fast64_t; public: u64 a; modint(const u64 x = 0) noexcept : a(x % Modulus) {} u64 &value() noexcept { return a; } //u64 &value() const noexcept { return a; } modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const modint rhs) const noexcept { return modint(*this) -= rhs; } constexpr modint operator*(const modint rhs) const noexcept { return modint(*this) *= rhs; } constexpr modint operator/(const modint rhs) const noexcept { return modint(*this) /= rhs; } modint &operator+=(const modint rhs) noexcept { a += rhs.a; if (a >= Modulus) { a -= Modulus; } return *this; } modint &operator-=(const modint rhs) noexcept { if (a < rhs.a) { a += Modulus; } a -= rhs.a; return *this; } modint &operator*=(const modint rhs) noexcept { a = a * rhs.a % Modulus; return *this; } modint &operator/=(modint rhs) noexcept { u64 exp = Modulus - 2; while (exp) { if (exp % 2) { *this *= rhs; } rhs *= rhs; exp /= 2; } return *this; } modint pow(u64 exp){ modint res=1,rhs=*this; while (exp) { if (exp % 2) { res *= rhs; } rhs *= rhs; exp /= 2; } return res; } friend ostream& operator<<(ostream& os,modint& rhs){ os << rhs.value(); return os; } friend istream& operator>>(istream &is,modint &rhs){ is>>rhs.value(); rhs.value()%=Modulus; return is; } }; using mint=modint<(int)1e9+7>; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n,m,k,p,q;cin>>n>>m>>k>>p>>q; mint pp=(mint)p/q; mint even=((mint(1)-pp*2).pow(k)+1)/2,odd=mint(1)-even; mint res=0; ll a; mint sa=0; rep(i,m){ cin>>a; sa+=a; } res+=sa*even; sa=0; rep(i,n-m){ cin>>a; sa+=a; } res+=odd*sa; cout<