Problem:
Score : 1100 points

Problem Statement

There is a set consisting of N distinct integers. The i-th smallest element in this set is S_i. We want to divide this set into two sets, X and Y, such that:

The absolute difference of any two distinct elements in X is A or greater.

The absolute difference of any two distinct elements in Y is B or greater.

How many ways are there to perform such division, modulo 10^9 + 7? Note that one of X and Y may be empty.

Constraints

All input values are integers.

1 ≦ N ≦ 10^5

1 ≦ A , B ≦ 10^{18}

0 ≦ S_i ≦ 10^{18}(1 ≦ i ≦ N)

S_i < S_{i+1}(1 ≦ i ≦ N - 1)

Input

The input is given from Standard Input in the following format:

N A B
S_1
:
S_N

Output

Print the number of the different divisions under the conditions, modulo 10^9 + 7.

Sample Input 1

5 3 7
1
3
6
9
12

Sample Output 1

5

There are five ways to perform division:

X={1,6,9,12}, Y={3}

X={1,6,9}, Y={3,12}

X={3,6,9,12}, Y={1}

X={3,6,9}, Y={1,12}

X={3,6,12}, Y={1,9}

Sample Input 2

7 5 3
0
2
4
7
8
11
15

Sample Output 2

4

Sample Input 3

8 2 9
3
4
5
13
15
22
26
32

Sample Output 3

13

Sample Input 4

3 3 4
5
6
7

Sample Output 4

0

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

//#define  NDEBUG

//#pragma optimize("tree-vectorize")
//#pragma optimize ("fast-math")
//#pragma optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#define all(v)                  v.begin(), v.end()
#define db(x)                   cout << #x << " = " << (x) << "\n"
#define fend(x)                 ((x) & ((x)+1)) - 1
#define fenu(x)                 (x) | ((x)+1)
#define forn(i, n)              for (int i = 0; i < (int)n; ++i)
#define forr(i, b, e)           for (int i = b; i < (int)e; ++i)
#define ft                      first
#define len(s)                  s.length()
#define mp                      std::make_pair
#define pob                     pop_back
#define pof                     pop_front
#define pub                     push_back
#define puf                     push_front
#define sc                      second

typedef double dbl;
typedef long double ldbl;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

const long long MILLER_RABIN = 3215031751;
const long double PI = acos(-1);

#if __cplusplus >= 201103L

struct config_io {
    config_io() {
        cin.tie(nullptr);
        cout.tie(nullptr);
        ios_base::sync_with_stdio(false);
    }
} cnf_io;

struct config_rand {
    config_rand() {
        srand(chrono::duration_cast<chrono::nanoseconds>(
                chrono::high_resolution_clock::now().time_since_epoch()).count());
    }
} cnf_rand;

namespace std {
    template<>
    struct hash<pair<int, int> > {
        size_t operator()(const pair<int, int>& x) const {
            return (x.first * 71ll + x.second) % ((int) 1e9 + 7);
        }
    };

    template<>
    struct hash<vector<int>> {
        size_t operator()(const vector<int>& v) const {
            size_t hsh = 0;
            for (int i = 0; i < v.size(); ++i) {
                hsh = (hsh * 71ll + v[i]) % (int) (1e9 + 7);
            }
            return hsh;
        }
    };
}

// __builtin_popcount(x) - Returns the number of 1-bits in x.
// __builtin_parity(x) - Returns the parity of x, i.e. the number of 1-bits in x modulo 2.
// __builtin_ffs(x) - Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero.
// __builtin_clz(x) - Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined.
// __builtin_ctz(x) - Returns the number of trailing 0-bits in x, starting at the least significant bit position. If x is 0, the result is undefined.

//inline string tobin(long long x) { bitset<63>(x).to_string(); }


template<class T>
void trace(T collection) {
    for (auto elem : collection) { cout << elem << " "; }
    cout << endl;
}

#endif

struct fenw {
    static const int MOD = 1e9 + 7;
    static const int ML = 1e5 + 10;
    int t[ML];
    stack<int> was_upd;

    fenw() { fill(t, t + ML, 0); }

    void clear() {
        while (!was_upd.empty()) {
            t[was_upd.top()] = 0;
            was_upd.pop();
        }
    }

    int sum(int r) {
        int res = 0;
        for (; r >= 0; r = fend(r)) {
            res = (res + t[r]) % MOD;
        }
        return res;
    }

    int sum(int l, int r) {
        return (((sum(r) - sum(l - 1)) % MOD) + MOD) % MOD;
    }

    int upd(int pos, int value) {
        int delta = value - sum(pos, pos);
        for (; pos < ML; pos = fenu(pos)) {
            t[pos] = (((t[pos] + value) % MOD) + MOD) % MOD;
            was_upd.push(pos);
        }
    }
};

int doit(vector<ll>& a, ll A, ll B) {
    const int MOD = 1e9 + 7;
    int n = a.size();
    fenw dpx, dpy;
    dpx.upd(0, 1);
    //dpx.upd(1, 1);
    dpy.upd(0, 1);
    //dpy.upd(1, 1);
    for (int i = 1; i < n; ++i) {
        int last_validx = upper_bound(all(a), a[i] - A) - a.begin() - 1;
        int last_validy = upper_bound(all(a), a[i] - B) - a.begin() - 1;
        int sumy = dpy.sum(0, last_validx);
        int sumx = dpx.sum(0, last_validy);
        if (a[i] - a[i - 1] < A) {
            dpx.clear();
        }
        dpx.upd(i - 1, sumy);
        if (a[i] - a[i - 1] < B) {
            dpy.clear();
        }
        dpy.upd(i - 1, sumx);
    }
    int ans = 0;
    forn(i, n) {
        ans = (ans + dpx.sum(i, i)) % MOD;
        ans = (ans + dpy.sum(i, i)) % MOD;
    }
    cout << ans << endl;
//    forn(i, n + 1) {
//        cout << dpx.sum(i, i) << " ";
//    }
//    cout << endl;
//    forn(i, n + 1) {
//        cout << dpy.sum(i, i) << " ";
//    }
//    cout << endl;
}

void solve(int test) {
    ll n, A, B;
    cin >> n >> A >> B;
    vector<ll> a(n + 1);
    a[0] = -1e18;
    forn(i, n) cin >> a[i + 1];
    doit(a, A, B);
}

int main() {
#ifdef HOME
    freopen("home.in", "r", stdin);
    freopen("home.out", "w", stdout);
#endif

    int tests = 1;
    //cin >> tests;
    for (int test = 1; test <= tests; ++test) {
        solve(test);
    }

#ifdef HOME
    cout << "\n\nTime: " << clock() / (double) CLOCKS_PER_SEC << endl;
#endif
    return 0;
}