#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>
#include <cmath>
#include <functional>
#include <map>
#include <cstdlib>
#include <stack>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;
using Graph = Vvec<int>;

const ll MOD = 1e9+7;

template <class T>
void debug(T& v)
{
    for(auto& x: v) cout << x << " ";
    cout << endl;
}

// SegmentTree
template <class DataType>
class SegmentTree
{
public:
    using OpType = std::function<DataType(DataType, DataType)>;
    int N;
    std::vector<DataType> dat;
    DataType e; // identity element
    OpType op;

    SegmentTree(std::vector<DataType>& base,
        DataType e0, OpType op0): e(e0), op(op0)
    {
        N = 1;
        while(N < base.size()) N *= 2;
        dat.resize(2*N-1);
        for(int i=0; i<N; i++)
            dat[i+N-1] = (i<base.size()) ? base[i] : e;
        for(int i=N-2; i>=0; i--) dat[i] = op(dat[2*i+1], dat[2*i+2]);
    }
    SegmentTree(size_t sz,
        DataType e0, OpType op0): e(e0), op(op0)
    {
        N = 1;
        while(N < sz) N *= 2;
        dat.resize(2*N-1);
        for(auto& x: dat) x = e;
    }
    void update(int index, DataType value){
        int i = index + N-1;
        dat[i] = value;
        while(i > 0){
            i = (i-1) / 2;
            dat[i] = op(dat[2*i+1], dat[2*i+2]);
        }
    }
    DataType subQuery(int qleft, int qright, int tmp, int sleft, int sright){
        if(qleft <= sleft && sright <= qright) return dat[tmp];
        if(sright <= qleft || qright <= sleft) return e;

        int mid = (sleft + sright) / 2;
        return op(subQuery(qleft, qright, 2*tmp+1, sleft, mid),
            subQuery(qleft, qright, 2*tmp+2, mid, sright));
    }
    DataType query(int left, int right){
        return subQuery(left, right, 0, 0, N);
    }
    void print(){
        for(int i=N-1; i<2*N-1; i++) std::cout << dat[i] << " ";
        std::cout << std::endl;
    }
};

int main()
{
    ll N, A, B;
    cin >> N >> A >> B;
    vector<ll> S(N);
    for(auto& x: S) cin >> x;

    SegmentTree<ll> dpA(N+1, 0, [&](ll a, ll b){
        return (a + b) % MOD;
    });
    SegmentTree<ll> dpB(N+1, 0, [&](ll a, ll b){
        return (a + b) % MOD;
    });

    int ka = 0, kb = 0;
    dpA.update(0, 1);
    dpB.update(0, 1);
    for(int i=1; i<N; i++){
        int ua = distance(S.begin(), upper_bound(S.begin(), S.end(), S[i]-A));
        int ub = distance(S.begin(), upper_bound(S.begin(), S.end(), S[i]-B));
        dpA.update(i, dpB.query(0, min(ua+1, i)));
        dpB.update(i, dpA.query(0, min(ub+1, i)));

        // dpA.print();
        // dpB.print();

        if(S[i-1] + A > S[i]){
            while(ka < i){
                dpA.update(ka, 0); ka++;
            }
        }
        if(S[i-1] + B > S[i]){
            while(kb < i){
                dpB.update(kb, 0); kb++;
            }
        }

        // dpA.print();
        // dpB.print();
        // cout << "\n";
    }

    cout << (dpA.query(0, N+1) + dpB.query(0, N+1)) % MOD << endl;
}

Measured memory_bytes: 5120