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 _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;
const int MOD = 1000 * 1000 * 1000 + 7;

//const int MAX = 1000007;

LL n, a, b;
LL x[200000];
LL dp[200000][2];
set< pair<LL, int> > f;
const int X = 131072;

struct Tree
{
    LL e[2*X];
    
    void init()
    {
        FOR (i,1,n) e[X+i] = x[i]-x[i-1];
        RFOR (i,X,0) e[i] = max(e[2*i],e[2*i+1]);
    }
    
    LL mx(int l, int r)
    {
        l += X; r+= X;
        LL W = 0;
        while (l <= r)
        {
            if (l%2 == 1)
            {
                W = max(W,e[l]);
                l++;
            }
            if (r%2 == 0)
            {
                W =max(W,e[r]);
                r--;
            }
            l/=2; r/=2;
        }
        return W;
    }
} T;

bool ok(int l, int r, LL dist)
{
    //cout << l<<" "<<r<<" "<<dist<<endl;
    if (l == r) return true;
    if (l < r && T.mx(l+1,r) >= dist) return true;
    return false;
}

int main()
{
    //freopen("in.txt", "r", stdin);
    //ios::sync_with_stdio(false); cin.tie(0);
    //freopen("/Users/Taras/Downloads/big_top.txt", "r", stdin);
    //freopen("/Users/Taras/Downloads/mout.txt", "w", stdout);
    
    cin >> n >> a >> b;
    FOR (i,0,n)
    {
        cin >> x[i];
        f.insert(MP(x[i],i));
    }
    T.init();
    dp[0][0] = dp[0][1] = 1;
    FOR (i,1,n)
    {
        // set 0;
        set< pair<LL, int> > :: iterator to = f.upper_bound(MP(x[i]-a,INF));
        if (to->second == i)
        {
            dp[i][0] = (dp[i-1][0]+dp[i-1][1])%MOD;
        }
        else
        {
            if (ok(to->second,i-1,b))
                dp[i][0] = dp[to->second][1];
        }
        // set 1;
        to = f.upper_bound(MP(x[i]-b,INF));
        if (to->second == i)
        {
            dp[i][1] = (dp[i-1][0]+dp[i-1][1])%MOD;
        }
        else
        {
            if (ok(to->second,i-1,a))
                dp[i][1] = dp[to->second][0];
        }
        //cout << dp[i][0]<<" "<<dp[i][1]<<endl;
    }
    
    cout << (dp[n-1][0]+dp[n-1][1])%MOD << endl;
}