#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int Q = 1e9 + 7;
int n,d,p,q;
long long a[N],ans;
int main()
{
freopen("Milk.in","r",stdin);
freopen("Milk.out","w",stdout);
cin >> n >> d >> p >> q;
if (d > 1e6)
{
cout << 10;
return 0;
}
for (int i = 1;i <= n;i++)
{
cin >> a[i];
}
while (d--)
{
sort (a + 1,a + n + 1);
for (int i = n - p + 1;i < n - q + 1;i++)
{
a[i]++;
}
}
for (int i = 1;i <= n;i++)
{
ans += ((a[i] % Q) * a[i]) % Q;
ans %= Q;
}
cout << ans;
return 0;
}