#include<bits/stdc++.h>
#define int long long
using namespace std;
ifstream fin("cirnoisclever.in");
ofstream fout("cirnoisclever.out");
auto mread = [](){
int x;
fin >> x;
return x;
};
const int N = 1e5 + 5, M = 1e4 + 5;
int n = mread(), l = mread(), r = mread(), t = mread(), f[N], s[M], a[N];
void add(int x, int k){
while(x <= M){
s[x] += k;
x += x & -x;
}
return;
}
int query(int x){
int ans = 0;
while(x){
ans += s[x];
x -= x & -x;
}
return ans;
}
signed main(){
for(int i = 1; i <= n; i ++)
a[i] = mread();
f[n] = 1;
for(int i = n - 1; i >= 1; i --){
if(i + l <= n){
add(a[i + l], f[i + l]);
}
f[i] = query(min(M, a[i] + t)) - query(max(0ll, a[i] - t - 1));
if(i + r <= n){
add(a[i + r], -f[i + r]);
}
}
fout << f[1];
return 0;
}