使用了最新版mingw
#include <bits/stdc++.h>
#define int __int128
using namespace std;
const int N=5e5+10,mod=1e9+7;
int read(){
int s=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
return s*f;
}
inline void print(int x){
if(x>9) print(x/10);
putchar(x%10+'0');
}
int n,m,k,q,fac[N]={1},a[N],ans=1;
int qpow(int m,int n){int ans=1;for(;n;n>>=1){if(n&1)ans=ans*m%mod;m=m*m%mod;}return ans;}
int inv(int x){return qpow(x,mod-2);}
int C(int m,int n){
if(m<n) return 0;
return fac[m]*inv(fac[n])%mod*inv(fac[m-n])%mod;
}
int f(int x){
int ans=a[m];
for(int i=m;i;i--) ans=(ans*x+a[i-1])%mod;
return ans;
}
signed main(){
for(int i=1;i<=N-10;i++) fac[i]=fac[i-1]*i%mod;
n=read(),m=read(),k=read(),q=read();
for(int i=0;i<=m;i++) a[i]=read();
ans=C(n,k);
ans=ans*f(q)%mod;
print(ans);
return 0;
}