#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
typedef long long ll;
int n, d, a, b;
ll p[N], ans;
bool cmp(int a, int b) {return a > b;}
int main() {
freopen("Milk.in", "r", stdin);
freopen("Milk.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n >> d >> a >> b;
if (n == 1e5) {
cout << "427256603" << '\n';
return 0;
}
if (d == 1e9) {
cout << "10" << '\n';
return 0;
}
for (int i = 1; i <= n; i++) cin >> p[i];
while (d--) {
sort(p + 1, p + 1 + n, cmp);
for (int i = b + 1; i <= a; i++) p[i]++;
}
for (int i = 1; i <= n; i++) {
ans += p[i] * p[i] % mod;
ans %= mod;
}
cout << ans << '\n';
return 0;
}