DP题，还可以，不是很难。

# DP

#include<cstdio>
#include<algorithm>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int maxn=100000+10,mo=1000000007;
ll a[maxn],A,B;
int tree[maxn*4],f[maxn];
int i,j,k,l,r,t,n,m,ans;
void change(int p,int l,int r,int a,int b){
if (l==r){
(tree[p]+=b)%=mo;
return;
}
int mid=(l+r)/2;
if (a<=mid) change(p*2,l,mid,a,b);else change(p*2+1,mid+1,r,a,b);
tree[p]=(tree[p*2]+tree[p*2+1])%mo;
}
int query(int p,int l,int r,int a,int b){
if (a>b) return 0;
if (l==a&&r==b) return tree[p];
int mid=(l+r)/2;
if (b<=mid) return query(p*2,l,mid,a,b);
else if (a>mid) return query(p*2+1,mid+1,r,a,b);
else return (query(p*2,l,mid,a,mid)+query(p*2+1,mid+1,r,mid+1,b))%mo;
}
int main(){
scanf("%d%lld%lld",&n,&A,&B);
if (A<B) swap(A,B);
fo(i,1,n) scanf("%lld",&a[i]);
a[0]=-A;
a[n+1]=a[n]+A;
f[0]=1;
change(1,0,n,0,f[0]);
l=0;r=0;
fo(i,1,n+1){
while (a[i]-a[r+1]>=A) r++;
if (i>=2&&a[i-1]-a[i-2]<B) l=i-2;
if (a[i]-a[i-1]>=A) f[i]=f[i-1];
(f[i]+=query(1,0,n,l,min(i-2,r)))%=mo;
if (i<=n&&a[i+1]-a[i-1]>=B) change(1,0,n,i,f[i]);
}
ans=f[n+1];
(ans+=mo)%=mo;
printf("%d\n",ans);
}