import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio, std.bitmanip;

immutable long MOD = 10L^^9 + 7;
long N, A, B;
long[] S;
long[long][long][] mem;


long dp(int n, long a, long b) {
    long a_ok = (S[n] - a >= A) ? -1 : a;
    long b_ok = (S[n] - b >= B) ? -1 : b;
    if (a_ok >= 0 && b_ok >= 0)
        return 0;
    if (n == N-1) {
        if (a_ok == -1 && b_ok == -1) return 2;
        else if (a_ok == -1 || b_ok == -1) return 1;
        else return 0;
    }
    if (a_ok in mem[n] && b_ok in mem[n][a_ok])
        return mem[n][a_ok][b_ok];

    long ret = 0;
    if (a_ok == -1) {
        ret = (ret + dp(n+1, S[n], b)) % MOD;
    }
    if (b_ok == -1) {
        ret = (ret + dp(n+1, a, S[n])) % MOD;
    }

    mem[n][a_ok][b_ok] = ret;
    return ret;

}

void main() {
    scanf("%lld %lld %lld", &N, &A, &B);
    S = new long[](N);
    foreach (i; 0..N)
        scanf("%lld", &S[i]);
    mem = new long[long][long][](N);

    dp(0, -A-1, -B-1).writeln;
}
