#include<iostream>
#include<cstdio>
using namespace std;
int b,c,n,i,s,l,r;int a[500001];
int main(){
freopen("xgame.in","r",stdin);freopen("xgame.out","w",stdout);
c=-1;
scanf("%d%d%d",n,l,r);
for (int i=0;i<=n;i++){
scanf("%d",a[i]);
}
for (int i=1;i<=n;i++){
for (int j;j<=i;j++){
if (a[i]+a[j]>l||a[i]+a[j]<r){
c++;
}
}
}
if (c>0) printf("1");
if (c<0) printf("0");
fclose(stdin);fclose(stdout);
return 0;
}