#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
int w1,h1,s1,w2,h2,s2,t;
scanf("%d %d %d",&w1,&h1,&s1);
scanf("%d %d %d",&w2,&h2,&s2);
if(w1==w2){
printf("Y e s");
}
else if(w2-w1==-6||w2-w1==1){
if(h1<h2)
printf("N o");
else if(h1==h2&&s1<s2)
printf("N o");
else if(h1==h2&&s1>=s2)
printf("Y e s");
else if(h1>h2)
printf("Y e s");
}
else
printf("N o");
return 0;
}