#include<stdio.h>
int main(){
int p[3];
int q[3];
int i;//4 0 0 5 0 1
for (i=0;i<3;i++){
scanf("%d",&p[i]);
}
getchar();
for (i=0;i<3;i++){
scanf("%d",&q[i]);
}
getchar();
if(q[0]>=p[0]){
if(q[0]-p[0]>=2){
printf("N o\n");
}
else {
if(q[0]==p[0])printf("Y e s\n");
else if(q[0]!=p[0]){
if(q[1]<p[1])printf("Y e s\n");
else if(q[1]==p[1]&&q[2]<=p[2])printf("Y e s\n");
else if(q[1]==p[1]&&q[2]>p[2])printf("N o\n");
else if(q[1]>p[1])printf("N o\n");
}
}
}
else {
p[0]=0;
if(q[0]-p[0]>=2){
printf("N o\n");
}
else {
if(q[0]==p[0])printf("Y e s\n");
else if(q[0]!=p[0]){
if(q[1]<p[1])printf("Y e s\n");
else if(q[1]==p[1]&&q[2]<=p[2])printf("Y e s\n");
else if(q[1]==p[1]&&q[2]>p[2])printf("N o\n");
else if(q[1]>p[1])printf("N o\n");
}
}
}
return 0;
}