#include <stdio.h>

int main(){
	long vi, vd, mi, md;

	scanf("%ld %ld", &vi, &vd);
	scanf("%ld %ld", &mi, &md);

	if(vi==md && vd==mi){
        printf("YES");
	}

	else if((mi>=vd-1 && mi<=(vd*2)+2) || (md>=vi-1 && md<=(vi*2)+2)){
        printf("YES");
    }
    else{
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
int main()
{

    int al,ar,bl,br;
    scanf("%d %d %d %d",&al,&ar,&bl,&br);
    if((br>=(al-1)&&br<=(2*(al+1)))||(bl>=(ar-1)&&bl<=(2*(ar+1))))
       printf("YES");
       else
        printf("NO");
    return 0;

}

#include<stdio.h>

int main()
{
    int al,ar,bl,br;
    scanf("%d%d",&al,&ar);
    scanf("%d%d",&bl,&br);

    if(br>=(al-1))
    {
        if((br%2)==0)
        {
            if(al>=((br/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else if(bl>=(ar-1))
            {
                if((bl%2)==0)
                {
                    if(ar>=((bl/2)-1))
                    {
                        printf("YES\n");
                        return 0;
                    }
                    else
                    {
                        printf("NO\n");
                        return 0;
                    }
                }
                else if(ar>=(bl/2))
                {
                    printf("YES\n");
                    return 0;
                }
                else
                {
                    printf("NO\n");
                    return 0;
                }

            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(al>=(br/2))
        {
            printf("YES\n");
            return 0;
        }
        else if(bl>=(ar-1))
        {
            if((bl%2)==0)
            {
                if(ar>=((bl/2)-1))
                {
                    printf("YES\n");
                    return 0;
                }
                else
                {
                    printf("NO\n");
                    return 0;
                }
            }
            else if(ar>=(bl/2))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }

        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }

    else if(bl>=(ar-1))
    {
        if((bl%2)==0)
        {
            if(ar>=((bl/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(ar>=(bl/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }

    }
    else
    {
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int gl,gr,bl,br;
    scanf("%d %d",&gl,&gr);
    scanf("%d %d",&bl,&br);
    if(br-2*gl-2<=0&&gl-br<=1||bl-2*gr-2<=0&&gr-bl<2)
     printf("YES\n");
    else
     printf("NO\n");
    //system("pause");
    return 0;
}

#include <stdio.h>
int main ()
{
    int gl;
    int gr;
    int bl;
    int br;

    scanf ("%d",&gl);
    scanf ("%d",&gr);
    scanf ("%d",&bl);
    scanf ("%d",&br);

    if ( lb (br,gl) || rb (bl,gr))
        printf ("YES");
    else
        printf ("NO");

}
int lb(int br, int gl)
{
    if (br!=gl)
    {
        if ((br<gl && br==gl-1) || (br>gl && (2*gl + 2 >= br)))
            return 1;
        else
            return 0;
    }
    else
        return 1;

}
int rb(int bl, int gr)
{
    if (bl!=gr)
    {
        if ((bl<gr && bl==gr-1) || (bl>gr && (2*gr + 2 >= bl)))
            return 1;
        else
            return 0;
    }
    else
        return 1;

}

#include<stdio.h>

int main(){
	int gl, gr, bl, br;
	scanf("%d%d", &gl, &gr);
	scanf("%d%d", &bl, &br);
	if(((gl-br<=1 && gl*2+2>=br) || (gr-bl<=1 && gr*2+2>=bl))){
		printf("YES");
	}else{
		printf("NO");
	}

	return 0;

}

#include<stdio.h>
int main()
{
    int bl,br,gl,gr;
    scanf("%d%d",&gl,&gr);
    scanf("%d%d",&bl,&br);
    if((br>=(gl-1) && br<=(gl+1)*2) || (bl>=(gr-1) && bl<=(gr+1)*2))
       printf("YES");
    else printf("NO");
        return(0);
}

#include <stdio.h>

int main()
{
    int boyr, boyl, girlr, girll;

    scanf("%d %d %d %d", &girlr, &girll, &boyr, &boyl);

    if(((girlr-1)<=boyl && boyl<=(girlr+1)*2) || ((girll-1)<=boyr && boyr<=(girll+1)*2))
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }

    return 0;
}

#include<stdio.h>

int main()
{
  int al,ar,bl,br;
  scanf("%i %i",&al,&ar);
  scanf("%i %i",&bl,&br);
  if((al-1<=br&&br<=2*(al+1))||(ar-1<=bl&&bl<=2*(ar+1)))
  { printf("YES");return 0;}
   printf("NO");return 0;
}

#include<stdio.h>
int hand(int,int);
int main()
{
    int a,b,c,d,z1,z2;
    scanf("%d %d",&a,&b);
    scanf("%d %d",&c,&d);
    z1=hand(a,d);
    z2=hand(b,c);
    if((z1==1)||(z2==1))
    printf("YES");
    else
    printf("NO");
    return(0);
}
int hand(int x,int z)
{
     if((x>z)&&(z!=0))
     {
            if(z==x-1)
            return(1);
            else
            return(0);
     }
     else if((x==z)&&(x!=0))
       return(1);
     else
     {
         if((z<=2*(x+1))&&(z>0))
         return(1);
         else
          return(0);
     }
}

#include<stdio.h>
int main()
{
    int gl,gr,bl,br;
    scanf("%d%d%d%d",&gl,&gr,&bl,&br);
    bl=bl-(gr+1);
    if(bl==0||bl==-1||bl==-2){printf("YES");return 0;}
    else
    {
        if(bl<=(gr+1)&&bl>=0)
        {printf("YES");return 0;}
    }
    br=br-(gl+1);
    if(br==0||br==-1||br==-2){printf("YES");return 0;}
    else
    {
        if(br<=(gl+1)&&br>=0)
        {printf("YES");return 0;}
        else
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
#include<math.h>
int main(void) {
    int bl,br,gl,gr;
    scanf("%d %d %d %d",&gl,&gr,&bl,&br);
    if(abs(bl-gr)<2||abs(br-gl)<2)  printf("YES");
    else if((bl<=2*gr+2&&bl>gr)||(br<=2*gl+2&&br>gl))   printf("YES");
    else    printf("NO");
    return 0;
}

#include <stdio.h>
int ok(int a,int b) {
  if(a>b+1) return 0;
  if(b>a*2+2) return 0;
  return 1;
}
int main() {
  int a,b,c,d;
  scanf("%d %d %d %d",&a,&b,&c,&d);
  if(ok(a,d) || ok(b,c)) puts("YES");
  else puts("NO");
  return 0;
}

#include <stdio.h>

int main(){

    int G1,G2,B1,B2;
    int exito=0;

    scanf("%d %d",&G1,&G2);
    scanf("%d %d",&B1,&B2);

    if( B2<G1 ){
        if( B2 == G1-1 ) exito=1;
    }else if( B2>G1 ){
        if( 2*G1+2 >= B2 ) exito=1;
    }else exito=1;

    if(!exito){
        if( B1<G2 ){
            if( B1 == G2-1 ) exito=1;
        }else if( B1>G2 ){
            if( 2*G2+2 >= B1 ) exito=1;
        }else exito=1;
    }

    if(exito)puts("YES");
    else puts("NO");

    return 0;
}

#include <stdio.h>

int main(){

    int A1,A2,B1,B2;
    int exito=0;

    scanf("%d %d",&A1,&A2);
    scanf("%d %d",&B1,&B2);

    if( B2<A1 ){
        if( B2 == A1-1 )/*puts("YES")*/ exito=1;
    }else if( B2>A1 ){
        if( 2*A1+2 >= B2 )/*puts("YES")*/exito=1;
    }else exito=1;

    if(!exito){
        if( B1<A2 ){
            if( B1 == A2-1 )/*puts("YES")*/ exito=1;
        }else if( B1>A2 ){
            if( 2*A2+2 >= B1 )/*puts("YES")*/exito=1;
        }else exito=1;
    }

    if(exito)puts("YES");
    else puts("NO");

    return 0;
}

#include <stdio.h>
#include <string.h>
int check_fing(int b, int g){
	int groups[102];
	int i;
	int correct = 1;
	memset(groups,0,102*sizeof(int));
	for(i = 0; b; i=(i+1)%(g+1)){
		groups[i]++;
		b--;
	}
	for(i = 0; i<g-1 && correct; i++)
		correct = (groups[i] > 0) && (groups[i]<=2);
	for(i = g-1; i<g+1 && correct; i++)
		correct = (groups[i] >= 0) && (groups[i]<=2);

	return correct;
}

int main(){
	int al, ar, bl, br;
	int res = 0;
	scanf("%d %d\n%d %d",&al,&ar,&bl,&br);
	res = check_fing(bl,ar) || check_fing(br,al);
	printf("%s\n", res ? "YES":"NO");
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
int gl,gr,bl,br,flag1=1,flag2=1;

    scanf("%d %d %d %d",&gl,&gr,&bl,&br);
    if((br<gl-1)||(gl<(br-1)/2))flag1=0;
    if((bl<gr-1)||(gr<(bl-1)/2))flag2=0;
    if(flag1||flag2)printf("YES");
    else printf("NO");

return 0;
}

#include <stdio.h>

int main()
{
    int vi, vd, mi, md;
    int aux = 0;
    scanf("%d%d%d%d", &vi, &vd, &mi, &md);

    if((vi <= md+1 && md <= vi*2+2) || (vd <= mi+1 && mi <= vd*2+2))
        aux += 1;

    if(aux)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include<stdio.h>

int main()
{
   int gl,gr,bl,br;

   scanf("%d %d",&gl,&gr);
   scanf("%d %d",&bl,&br);

   if((bl>=gr-1 && bl<=2*(gr+1))||(br>=gl-1 && br<=2*(gl+1)))
       printf("YES");

   else
       printf("NO");

   return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main() {
	int al, ar, bl, br;
	scanf("%d%d%d%d", &al, &ar, &bl, &br);
	if ((bl >= ar - 1 && bl <= (ar + 1) * 2) || (br >= al - 1 && br <= (al + 1) * 2))
		printf("YES\n");
		else printf("NO\n");

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main() {
	int al, ar, bl, br;
	scanf("%d%d%d%d", &al, &ar, &bl, &br);
	if ((bl >= ar - 1 && bl <= (ar + 1) * 2) || (br >= al - 1 && br <= (al + 1) * 2))
		printf("YES\n");
	else printf("NO\n");

	return 0;
}

#include <stdio.h>

int main()
{
     int al, ar, bl, br;

     scanf("%d %d %d %d", &al, &ar, &bl, &br);

     if (bl >= ar - 1 && bl <= ar * 2 + 2) {
      puts("YES");
     } else if (br >= al - 1 && br <= al * 2 + 2) {
      puts("YES");
     } else {
      puts("NO");
     }

     return 0;
}

#include <stdio.h>

int main(){

    int G1,G2,B1,B2;
    int exito = 0;

    scanf("%d %d", &G1, &G2);
    scanf("%d %d", &B1, &B2);

    if( B2 < G1 ){
        if( B2 == G1-1 )
            exito=1;
    }else if( B2 > G1 ){
        if( 2*G1 + 2 >= B2 )
            exito = 1;
    }else
        exito = 1;

    if(!exito){
        if( B1 < G2 ){
            if( B1 == G2-1 )
                exito=1;
        }else if( B1 > G2 ){
            if( 2*G2 + 2 >= B1 )
                exito=1;
        }else
            exito=1;
    }

    if(exito)
        puts("YES");
    else
        puts("NO");

    return 0;
}

#include <stdio.h>

int main( void )
{
    int gl, gr, bl, br;
    scanf( "%d %d %d %d", &gl, &gr, &bl, &br );
    if ( ( br + 1 >= gl && 2 * gl + 2 >= br ) || ( bl + 1 >= gr && 2 * gr + 2 >= bl ) ) {
        puts( "YES" );
    } else {
        puts( "NO" );
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int A,B,C,D;
int main(){
	scanf("%d%d%d%d",&A,&B,&C,&D);
	if((A*2+3>D&&D+1>=A)||(B*2+3>C&&C+1>=B))
        puts("YES");
	else puts("NO");
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8

int mano_venus(char* venusString, int num);
int mano_marte(char* marteString, int num);
int comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];
    char auxVenus[MAX], auxMarte[MAX];

    int hand_venus, hand_mars;

    gets(venus); strcpy(auxVenus, venus);
    gets(marte); strcpy(auxMarte, marte);

    hand_venus = mano_venus(venus, 1);
    hand_mars = mano_marte(marte, 1);

   if (hand_venus != -1 && hand_mars != -1)
    {
        if(comfortable(hand_venus, hand_mars))
        {
            printf("YES");
        }else{
            hand_venus = mano_venus(auxVenus, 2);
            hand_mars = mano_marte(auxMarte, 2);
            if (comfortable(hand_venus, hand_mars))
            {
                printf("YES");
            }else{
                printf("NO");
            }
        }
    }

    return 0;
}

int comfortable(int venusiana, int marciano)
{
    int k = 0;

    if (venusiana > marciano)
    {
        if (marciano == (venusiana - 1))
        {
            k = 1;
        }
    }
    if (venusiana < marciano)
    {
        if (2*venusiana +2 >= marciano)
        {
            k = 1;
        }
    }
    if (venusiana == marciano)
    {
        k = 1;
    }

    return k;
}

int mano_venus(char* venusString, int num)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);
    int k = -1;

    char* manoVenusIzq = strtok(venusString, " ");
    char* manoVenusDer = strtok(NULL, " ");

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)
        {
            if(num == 1)
            {
                k = atoi(manoVenusIzq);
            }else{
                k = atoi(manoVenusDer);
            }
        }
    }

    return k;
}

int mano_marte(char* marteString, int num)
{
    char* manoMarteIzq = strtok(marteString, " ");
    char* manoMarteDer = strtok(NULL, " ");
    int k = -1;

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) <= 100)
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) <= 100)
        {
            if(num == 1)
            {
                k = atoi(manoMarteDer);
            }else{
                k = atoi(manoMarteIzq);
            }
        }
    }

    return k;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8//maxima cantidad de elementos a introducir

int mano_venus(char* venusString, int num);
int mano_marte(char* marteString, int num);
int comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];//se crean los vectores de tamaño 8 para la lectura
    char auxVenus[MAX], auxMarte[MAX];//se crean los vectores de tamaño MAX para el input

    int hand_venus, hand_mars;//variable de validacion de cantidad de dedos

    gets(venus); strcpy(auxVenus, venus); //se obtienen los datos de la venusiana y se copian en un vector auxiliar para la tokenizacion
    gets(marte); strcpy(auxMarte, marte);//se obtienen los datos del marciano y se copian los datos en un vector auxiliar para la tokenizacion

    hand_venus = mano_venus(venus, 1);//El caso 1 es mano izquierda venus, mano derecho marte
    hand_mars = mano_marte(marte, 1);

   if (hand_venus != -1 && hand_mars != -1)//Si ambos no exceden el limite de dedos
    {
        if(comfortable(hand_venus, hand_mars))//llama a la funcion comfortable
        {
            printf("YES");
        }else{//Si no se sienten comodos
            hand_venus = mano_venus(auxVenus, 2);//El caso 2 es mano derecha de la venusiana e izquierda del marciano
            hand_mars = mano_marte(auxMarte, 2);
            if (comfortable(hand_venus, hand_mars))//Si ambos se sienten comodos
            {
                printf("YES");//imprime si
            }else{
                printf("NO");//Si no, no.
            }
        }
    }

    return 0;
}

int comfortable(int venusiana, int marciano)//Recibe cantidad de dedos
{
    int k = 0;

    if (venusiana > marciano)//Si la cantidad de dedos de la venusiana es mayor al marciano
    {
        if (marciano == (venusiana - 1))//y si la cantidad de dedos del marciano es igual a la de la venusiana -1
        {
            k = 1;//Entonces se sienten comodos
        }
    }
    if (venusiana < marciano)//Si la cantidad de dedos de la venusiana es menor que la del marciano
    {
        if (2*venusiana +2 >= marciano)//Si 2*cantidad de dedos de la venusiana + 2 es mayor o igual a la del marciano
        {
            k = 1;//se sienten comodos
        }
    }
    if (venusiana == marciano)//si tienen igual cantidad de dedos
    {
        k = 1;//se sienten comodos
    }

    return k;//retorna k
}

int mano_venus(char* venusString, int num)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);
    int k = -1;

    char* manoVenusIzq = strtok(venusString, " ");//tokeniza y almacena la cantidad de dedos de la izquierda
    char* manoVenusDer = strtok(NULL, " ");//tokeniza y almacena la cantidad de dedos de la derecha

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)//si los dedos de la izquierda no exceden de 100
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)//si los dedos de la derecha no exceden de 100
        {
            if(num == 1)//Si num es igual a 100
            {
                k = atoi(manoVenusIzq);//k es igual a cantidad de dedos en la mano izquierda del marciano
            }else{
                k = atoi(manoVenusDer);//k es igual a cantidad de dedos en la mano derecha del marciano
            }
        }
    }

    return k;//retorna k
}

int mano_marte(char* marteString, int num)
{
    char* manoMarteIzq = strtok(marteString, " ");//se tokeniza para obtener la mano izquierda
    char* manoMarteDer = strtok(NULL, " ");//se vuelve a tokenizar para obtener la mano derecha
    int k = -1;

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) <= 100)//Si la mano izquierda no excede de 100
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) <= 100)//si su mano derecha no excede de 100
        {
            if(num == 1)//Si num es igual a 1
            {
                k = atoi(manoMarteDer);//k es igual a cantidad de dedos en la mano derecha
            }else{
                k = atoi(manoMarteIzq);//k es igual a cantidad de dedos en la mano izquierda
            }
        }
    }

    return k;//retorna k
}

#include<stdio.h>
#include<math.h>
void ver(int mujeri,int mujerd,int machoi,int machod);
int main()
{
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    ver(a,b,c,d);
    return 0;
}
void ver(int mujeri,int mujerd,int machoi,int machod)
{
    if(machod>=mujeri && (machod-mujeri)-1<3 || machoi>=mujerd && (machoi-mujerd)-1<3 || mujerd-machoi==1 || mujeri-machod==1 || machod>mujeri && machod<=2+mujeri*2 || machoi>mujerd && machoi<=2+mujerd*2)printf("YES");
    else printf("NO");
}

#include<stdio.h>
int main()
{
    int al,ar,bl,br;
    scanf("%d%d%d%d",&al,&ar,&bl,&br);
    if(br>=(al-1)&&br<=(al+1)*2)
        printf("YES\n");
    else if(bl>=(ar-1)&&bl<=(ar+1)*2)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
    int gr, gl, br, bl, i, a=0;
    scanf("%d %d", &gl, &gr);
    scanf("%d %d", &bl, &br);
    if(gl==br || bl==gr){
        printf("YES");
        return 0;
    }
    if(gl>br && (gl-br)<=1){
        printf("YES");
        return 0;
    }
    else if(gr>bl && (gr-bl)<=1){
        printf("YES");
        return 0;
    }
    if(br%2==0){
        br=br-1;
    }
    if(br>=gl && gl>=(br/2)){
        printf("YES");
        return 0;
    }
    if(bl%2==0){
        bl=bl-1;
    }
    if(bl>=gr && gr>=(bl/2)){
        printf("YES");
         return 0;
    }
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
	int gr,gl,br,bl,i;
	scanf("%d%d",&gr,&gl);
	scanf("%d%d",&br,&bl);
	if((bl-gr>=-1 && (bl-2*gr)<3) || (br-gl>=-1 && br-(2*gl)<3))
	printf("YES\n");
	else
	printf("NO\n");
	return 0;
}

#include <stdio.h>

int main(){
    int ar, al, br, bl;

    scanf("%d%d%d%d",&ar,&al,&br,&bl);

    if (((bl>=ar-1)&&(bl<=ar*2+2))||  ((br>=al-1)&&(br<=al*2+2))){
        printf("YES");
    }else{
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int a1,a2,b1,b2;
	scanf("%d%d%d%d",&a1,&a2,&b1,&b2);
	if((a1<=b2+1&&a1*2+3>b2)||(a2<=b1+1&&a2*2+3>b1))
	printf("YES");
	else
	printf("NO");

}

#include <stdio.h>
int main()
{
 int al,ar,bl,br;
 scanf("%d%d%d%d",&al,&ar,&bl,&br);
 if((bl>=ar-1&&ar*2>bl-3)||(br>=al-1&&al*2>br-3))
 {
  printf("YES\n");
  return 0;
 }
 printf("NO\n");
 return 0;
}

#include<ctype.h>
#include<limits.h>
#include<math.h>
#include<stdbool.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void)
{
    int a1, a2, b1, b2;

    scanf("%d%d%d%d", &a1, &a2, &b1, &b2);

    if(((a1 - 1) <= b2 && (double)b2 / (a1 + 1) <= 2)
        ||((a2 - 1) <= b1 && (double)b1 / (a2 + 1) <= 2))
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include<stdio.h>
#include<math.h>
int cei(int a)
{
	int b=a/2;
	if(a==b*2)
	return b;
	else return b+1;
}
int flag=0;
void fun(int boy,int girl)
{
	if(girl>=cei(boy)-1 &&  girl<=boy+1)
	{
		printf("YES\n");
		flag=1;
		return ;
	}
}

int main()
{
	int boy[2],girl[2];
	scanf("%d%d",&girl[0],&girl[1]);
	scanf("%d%d",&boy[0],&boy[1]);
	fun(boy[0],girl[1]);
	if(flag==0)fun(boy[1],girl[0]);
	if(flag==0)
	printf("NO\n");
	return 0;
	}

#include<stdio.h>
main()
{
int al,ar,bl,br;
scanf("%d%d%d%d",&al,&ar,&bl,&br);
int b1=0,b2=0;
if(ar==1 && bl<=4)
{
printf("YES\n");
return 0;
}
if(al==1 && br<=4)
{
printf("YES\n");
return 0;
}
/*if(ar==1 && bl>4)
{
printf("NO\n");
return 0;
}
if(al==1 && br>4)
{
printf("NO\n");
return 0;
}*/
if(bl>=ar-1 && bl<=2*(ar+1))
b1=1;
if(br>=al-1 && br<=2*(al+1))
b2=1;
if(b1==1||b2==1)
printf("YES\n");
else
printf("NO\n");
return 0;
}

#include"stdio.h"
int funcion(int x,int y){
    if((x+1)*2>=y && (y+1)>=x)
        return 1;
    else
        return 0;
        }
int main(){
    int al,ar,bl,br,k;
    while(scanf("%d %d %d %d",&al,&ar,&bl,&br)!=EOF){
        k=funcion(al,br)+funcion(ar,bl);
        if(k>=1)
            printf("YES\n");
        else
            printf("NO\n");
        k=0;}
//getch();
return 0;
}

#include <stdio.h>

int main(int argc, char *argv[])
{
    int al, ar, bl, br;

    scanf("%d %d %d %d", &al, &ar, &bl, &br);

    if((ar - 1 <= bl && bl <= 2 * ar + 2) || (al - 1 <= br && br <= 2 * al + 2))
        puts("YES");
    else
        puts("NO");

    return 0;
}

#include <stdio.h>
int main()
{
    int al,ar,bl,br;
    scanf("%d%d\n%d%d",&al,&ar,&bl,&br);
    if((al-br<2)&&(br<2*al+3)||(ar-bl<2)&&(bl<2*ar+3))    {
        printf("YES\n");
    }
    else    {
        printf("NO\n");
    }
    return 0;
}

# include <stdio.h>
# include <string.h>

main(){
  int R, L, l, r;
  scanf("%d %d", &L, &R);
  scanf("%d %d", &l, &r);
  if( R  - 1 <= l && (R + 1) * 2 >= l ) printf("YES\n");
  else if( L - 1 <= r && (L + 1)*2 >= r ) printf("YES\n");
  else printf("NO\n");
  return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a1, a2, b1, b2, temp, temp2;
    scanf("%d %d %d %d", &a1, &a2, &b1, &b2);
    if(a1 >= b2)
    {
          if(a1 - b2 <= 1)
          {
                printf("YES");
                return 0;
          }
    }
    else
    {
          if(b2 - a1 - 1 <= b2 / 2)
          {
                printf("YES");
                return 0;
          }
    }
    if(a2 >= b1)
    {
          if(a2 - b1 <= 1)
          {
                printf("YES");
                return 0;
          }
    }
    else
    {
          if(b1 - a2 - 1 <= b1 / 2)
          {
                printf("YES");
                return 0;
          }
    }
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int bl,br,gl,gr;
    scanf("%d%d",&gl,&gr);
    scanf("%d%d",&bl,&br);
    if((br>=(gl-1) && br<=(gl+1)*2) || (bl>=(gr-1) && bl<=(gr+1)*2))
       printf("YES");
    else printf("NO");
        return 0;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int b, int x)
{
	int y, z, c,a;
	z=0;
	if(x < b)
	{
		if(x == b-1)
		{
			z=1;
		}
	}
	else
	{
		if( x > b)
		{
			c = 2*b+2;
			if( ( c >= x ) || (x-b-1 < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	return z;
}

#include <stdio.h>
#include <string.h>
int main()
{
	int a1,a2,b1,b2;
	scanf("%d %d %d %d", &a1,&a2,&b1,&b2);
	if(a1 - b1 > 2 || a1 - b1 > 2)
	{
		printf("NO");
	}else if( b1 <= 2 * a1 + 2 && b1 <= 2 * a1 + 2)
		{
			printf("YES");
		}
	else{
		printf("NO");
	}
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &g_r, &g_l, &b_r, &b_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if(((b_l>=g_r) || tot2<=1) && ((b_l / 3<=g_r)))
        printf("YES\n");

    else if(((b_r>=g_l) || tot1<=1) && ((b_r / 3<= g_l)))
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int b, int x)
{
	int y, z, c,a;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		if(x == b-1)
		{
			z=1;
		}
	}
	else
	{
		if( x > b)
		{
			c = 2*b-1;
			if( ( c >= x ) || (x-b-1 < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
}
	return z;
}

#include<stdio.h>

int main()
{
    int al,ar,bl,br;
    scanf("%d%d",&al,&ar);
    scanf("%d%d",&bl,&br);

    if(br>=(al-1))
    {
        if((br%2)==0)
        {
            if(al>=((br/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(al>=(br/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }
    else if(bl>=(ar-1))
    {
        if((bl%2)==0)
        {
            if(ar>=((bl/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(ar>=(bl/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }

    }

    else
    {
        printf("NO\n");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8

int mano_venus(char* venusString, int num);
int mano_marte(char* marteString, int num);
int comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];
    char auxVenus[MAX], auxMarte[MAX];

    int hand_venus, hand_mars;

    gets(venus); strcpy(auxVenus, venus);
    gets(marte); strcpy(auxMarte, marte);

    hand_venus = mano_venus(venus, 1);
    hand_mars = mano_marte(marte, 1);

   if (hand_venus != -1 && hand_mars != -1)
    {
        if(comfortable(hand_venus, hand_mars))
        {
            printf("YES");
        }else{
            hand_venus = mano_venus(auxVenus, 2);
            hand_mars = mano_marte(auxMarte, 2);
            if (comfortable(hand_venus, hand_mars))
            {
                printf("YES");
            }else{
                printf("NO");
            }
        }
    }

    return 0;
}

int comfortable(int venusiana, int marciano)
{
    int k = 0;

    if (venusiana > marciano)
    {
        if (marciano == (venusiana - 1))
        {
            k = 1;
        }
    }
    if (venusiana < marciano)
    {
        if (2*venusiana +2 >= marciano)
        {
            k = 1;
        }
    }
    if (venusiana == marciano)
    {
        k = 1;
    }

    return k;
}

int mano_venus(char* venusString, int num)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);
    int k = -1;

    char* manoVenusIzq = strtok(venusString, " ");
    char* manoVenusDer = strtok(NULL, " ");

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)
        {
            if(num == 1)
            {
                k = atoi(manoVenusIzq);
            }else{
                k = atoi(manoVenusDer);
            }
        }
    }

    return k;
}

int mano_marte(char* marteString, int num)
{
    char* manoMarteIzq = strtok(marteString, " ");
    char* manoMarteDer = strtok(NULL, " ");
    int k = -1;

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) < 100)
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) < 100)
        {
            if(num == 1)
            {
                k = atoi(manoMarteDer);
            }else{
                k = atoi(manoMarteIzq);
            }
        }
    }

    return k;
}

    /****************************
    *   Trabajo Practico Final  *
    *     A Student's Dream     *
    ****************************/
#include <stdio.h>

int main(){

    int Vi,Vd,Mi,Md;
    int exito=0;

    scanf("%d %d",&Vi,&Vd);
    scanf("%d %d",&Mi,&Md);

    if( Md<Vi ){
        if( Md == Vi-1 )
            exito=1;
    }else if( Md>Vi ){
        if( 2*Vi+2 >= Md )
            exito=1;
    }else exito=1;

    if(!exito){
        if( Mi<Vd ){
            if( Mi == Vd-1 )
                exito=1;
        }else if( Mi>Vd ){
            if( 2*Vd+2 >= Mi )
                exito=1;
        }else exito=1;
    }
    if(exito)
        printf("SI\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
int main()
{
    int a,b,c,d,r=0;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    if(a > d && r==0)
    {
        r++;
        if(d == a-1)
            printf("YES");
        else
            printf("NO");
    }
    else if(d >= a && r==0)
    {
        r++;
        if(d == a || d==a+1 || d==a+2)
            printf("YES");
        else
            printf("NO");
    }
    else if(b > c && r==0)
    {
        r++;
        if(c == b - 1)
            printf("YES");
        else
            printf("NO");
    }
    else if(c >= b && r==0)
    {
        r++;
        if(c==b || c==b+1 || c==b+2)
            printf("YES");
        else
            printf("NO");
    }
    return 0;
}

#include <stdio.h>
#include<math.h>
int main(void) {
    int bl,br,gl,gr;
    scanf("%d %d %d %d",&gl,&gr,&bl,&br);
    if(abs(bl-gr)<2||abs(br-gl)<2)  printf("YES");
    else if((bl<=2*gr+2&&bl>gr)||(br<=2*gl+2==2&&br>gl))    printf("YES");
    else    printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8

int mano_venus(char* venusString, int num);
int mano_marte(char* marteString, int num);
int comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];
    char auxVenus[MAX], auxMarte[MAX];

    strcpy(auxVenus, venus); strcpy(auxMarte, marte);

    int hand_venus, hand_mars;

    gets(venus);
    gets(marte);

    hand_venus = mano_venus(venus, 1);
    hand_mars = mano_marte(marte, 1);

    if (hand_venus != -1 && hand_mars != -1)
    {
       if(comfortable(hand_venus, hand_mars))
       {
            printf("YES");
       }else{
            hand_venus = mano_venus(auxVenus, 2);
            hand_mars = mano_marte(auxMarte, 2);
            if(comfortable(hand_venus, hand_mars))
            {
                printf("YES");
            }else{
                printf("NO");
            }
       }
    }

    return 0;
}

int comfortable(int venusiana, int marciano)
{
    if ((venusiana - marciano) == 0 || abs(venusiana - marciano) == 1)
    {
        return 1;
    }else{
        return -1;
    }
}

int mano_venus(char* venusString, int num)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);

    char* manoVenusIzq = strtok(venusString, " ");
    char* manoVenusDer = strtok(NULL, " ");

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)
        {
            if(num == 1)
            {
                return atoi(manoVenusIzq);
            }else{
                return atoi(manoVenusDer);
            }
        }
    }

    return -1;
}

int mano_marte(char* marteString, int num)
{
    char* manoMarteIzq = strtok(marteString, " ");
    char* manoMarteDer = strtok(NULL, " ");

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) < 100)
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) < 100)
        {
            if(num == 1)
            {
                return atoi(manoMarteDer);
            }else{
                return atoi(manoMarteIzq);
            }
        }
    }

    return -1;
}

#include<stdio.h>
#include<stdlib.h>
#define M 200

int analizar_comodidad(int manoNinhaNinho[]);

main()
{
    int manos[4], comodo, i;

    for(i=0; i<4; i++)
    {
    	scanf("%d", &manos[i]);
    }

    comodo = analizar_comodidad(manos);

    if(comodo == 1)
    {
        printf("YES");
    }
	else
	{
        printf("NO");
    }

    return 0;
}

int analizar_comodidad(int manoNinhaNinho[]) // 1 es YES, 0 es NO
{
    int A_izq, A_der, B_izq, B_der, a, b, r, div, resto;

    A_izq = manoNinhaNinho[0];
    A_der = manoNinhaNinho[1];
    B_izq = manoNinhaNinho[2];
    B_der = manoNinhaNinho[3];

    a = B_izq - A_der;
    b = B_der - A_izq;

    if(a >= -2 && a <= 2)
    {
    	if(a == -2)
    	{
    		if(b >= -2 && b <= 2)
            {
            	if(b == -2)
    	        {
    		       r = 0;
    	        }
    	        else
    	        {
    		       r = 1;
    	        }
            }
            else if(b > 2)
            {
            	if(A_izq == 1)
            	{
            		div = B_der / (A_izq + 1);
    	            resto = B_der % (A_izq + 1);
    	        }
    	        else
    	        {
    	        	div = B_der / A_izq;
    	            resto = B_der % A_izq;
    	        }

    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	if(div + resto > 3)
    			        {
    			        	r = 0;
    		 	        }
    			        else
    			        {
    			        	r = 1;
    			        }
    		        }
    		        else
    		        {
    			        if(resto/2 < A_izq)
    			        {
    			        	r = 1;
    			        }
    			        else
    			        {
    			        	r = 0;
    			        }
    		        }
    	        }
    	        else
    	        {
    		        r = 0;
    	        }
            }
            else if(b < -2)
            {
            	r = 0;
            }
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(a > 2 && (b <= -2 || b >= 2))
    {
    	if(A_der == 1)
        {
            div = B_izq / (A_der + 1);
    	    resto = B_izq % (A_der + 1);
    	}
    	else
    	{
    	    div = B_izq / A_der;
    	    resto = B_izq % A_der;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 3)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_der)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		if(b > 2)
            {
            	if(A_izq == 1)
                {
                	div = B_der / (A_izq + 1);
    	            resto = B_der % (A_izq + 1);
    	        }
    	        else
    	        {
    	        	div = B_der / A_izq;
    	            resto = B_der % A_izq;
    	        }

    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	if(div + resto > 3)
    			        {
    			        	r = 0;
    			        }
    			        else
    			        {
    			        	r = 1;
    			        }
    		        }
    		        else
    		        {
    		        	if(resto/2 < A_izq)
    			        {
    			        	r = 1;
    			        }
    			        else
    			        {
    			        	r = 0;
    			        }
    		        }
    	        }
    	        else
            	{
            		r = 0;
    	        }
            }
            else
            {
            	r = 0;
            }
    	}
    }
    else if(b >= -2 && b <= 2)
    {
    	if(b == -2)
    	{
    		r = 0;
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(b > 2)
    {
    	if(A_izq == 1)
        {
            div = B_der / (A_izq + 1);
    	    resto = B_der % (A_izq + 1);
    	}
    	else
    	{
    	    div = B_der / A_izq;
    	    resto = B_der % A_izq;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 3)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_izq)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(a < -2 || b < -2)
    {
    	r = 0;
    }

    return r;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &b_r, &b_l, &g_r, &g_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if(tot1<3 || tot2<3)
        printf("YES\n");

    else
        printf("NO\n");

    return 0;
}

#include <stdio.h>

int main(){
	long al, ar, bl, br;

	scanf("%ld %ld", &al, &ar);
	scanf("%ld %ld", &bl, &br);
	al--;
	bl--;

    if((br<=(al+2)*2 && br>=al) || (ar<=(bl+2)*2 && ar>=bl)){
        printf("YES");
        return 0;
    }

    printf("NO");
    return 0;
}

#include<stdio.h>

int main()
{
	int a, b, c, d, i=0;
	scanf("%d %d", &a, &b);
	scanf("%d %d", &c, &d);
	if((d>=a-1)&&(d<=a+3)||(c>=b-1)&&(c<=b+3))
		printf("YES");
	else printf("NO");
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int g_l,g_r,b_l,b_r,k,k1;
    scanf("%d",&g_l);
    scanf("%d",&g_r);
    scanf("%d",&b_l);
    scanf("%d",&b_r);
    k=(b_r/2);
    k1=(b_l/2);
    if((b_r>=g_l-1)&&(k<3))
    {
        printf("YES");
    }
    else if((b_l>=g_r-1)&&(k1<3))
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }

    return 0;
}

#include<stdio.h>

int main()
{
    int al,ar,bl,br;
    scanf("%d%d",&al,&ar);
    scanf("%d%d",&bl,&br);
    al-=1;
    ar-=1;
    if(br>=al)
    {
        if((br%2)==0)
        {
            if(al>=((br/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(al>=(br/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }
    else if(bl>=ar)
    {
        if((bl%2)==0)
        {
            if(ar>=((bl/2)-1))
            {
                printf("YES\n");
                return 0;
            }
            else
            {
                printf("NO\n");
                return 0;
            }
        }
        else if(ar>=(bl/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }

    }

    else
    {
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define M 200

int analizar_comodidad(int manoNinhaNinho[]);

main()
{
    int manos[4], comodo, i;

    for(i=0; i<4; i++)
    {
    	scanf("%d", &manos[i]);
    }

    comodo = analizar_comodidad(manos);

    if(comodo == 1)
    {
        printf("YES");
    }
	else
	{
        printf("NO");
    }

    return 0;
}

int analizar_comodidad(int manoNinhaNinho[]) // 1 es YES, 0 es NO
{
    int A_izq, A_der, B_izq, B_der, a, b, r, div, resto;

    A_izq = manoNinhaNinho[0];
    A_der = manoNinhaNinho[1];
    B_izq = manoNinhaNinho[2];
    B_der = manoNinhaNinho[3];

    a = B_izq - A_der;
    b = B_der - A_izq;

    if(a >= -2 && a <= 2)
    {
    	if(a == -2)
    	{
    		if(b >= -2 && b <= 2)
            {
            	if(b == -2)
    	        {
    		       r = 0;
    	        }
    	        else
    	        {
    		       r = 1;
    	        }
            }
            else if(b > 2)
            {
            	div = B_der / A_izq;
    	        resto = B_der % A_izq;
    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	r = 1;
    		        }
    		        else
    		        {
    			        r = 0;
    		        }
    	        }
    	        else
    	        {
    		        r = 0;
    	        }
            }
            else if(b < -2)
            {
            	r = 0;
            }
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(a > 2 && (b <= -2 || b >= 2))
    {
    	div = B_izq / A_der;
    	resto = B_izq % A_der;
    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			r = 1;
    		}
    		else
    		{
    			r = 0;
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(b >= -2 && b <= 2)
    {
    	if(b == -2)
    	{
    		r = 0;
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(b > 2)
    {
    	div = B_der / A_izq;
    	resto = B_der % A_izq;
    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			r = 1;
    		}
    		else
    		{
    			r = 0;
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(a < -2 || b < -2)
    {
    	r = 0;
    }

    return r;
}

#include<stdio.h>
#include<stdlib.h>
#define M 200

int analizar_comodidad(int manoNinhaNinho[]);

main()
{
    int manos[4], comodo, i;

    for(i=0; i<4; i++)
    {
    	scanf("%d", &manos[i]);
    }

    comodo = analizar_comodidad(manos);

    if(comodo == 1)
    {
        printf("YES");
    }
	else
	{
        printf("NO");
    }

    return 0;
}

int analizar_comodidad(int manoNinhaNinho[]) // 1 es YES, 0 es NO
{
    int A_izq, A_der, B_izq, B_der, a, b, r, div, resto;

    A_izq = manoNinhaNinho[0];
    A_der = manoNinhaNinho[1];
    B_izq = manoNinhaNinho[2];
    B_der = manoNinhaNinho[3];

    a = B_izq - A_der;
    b = B_der - A_izq;

    if(a >= -2 && a <= 2)
    {
    	if(a == -2)
    	{
    		if(b >= -2 && b <= 2)
            {
            	if(b == -2)
    	        {
    		       r = 0;
    	        }
    	        else
    	        {
    		       r = 1;
    	        }
            }
            else if(b > 2)
            {
            	if(A_izq == 1)
            	{
            		div = B_der / (A_izq + 1);
    	            resto = B_der % (A_izq + 1);
    	        }
    	        else
    	        {
    	        	div = B_der / A_izq;
    	            resto = B_der % A_izq;
    	        }

    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	if(div + resto > 2)
    			        {
    			        	r = 0;
    		 	        }
    			        else
    			        {
    			        	r = 1;
    			        }
    		        }
    		        else
    		        {
    			        if(resto/2 < A_izq)
    			        {
    			        	r = 1;
    			        }
    			        else
    			        {
    			        	r = 0;
    			        }
    		        }
    	        }
    	        else
    	        {
    		        r = 0;
    	        }
            }
            else if(b < -2)
            {
            	r = 0;
            }
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(a > 2 && (b <= -2 || b >= 2))
    {
    	if(A_der == 1)
        {
            div = B_izq / (A_der + 1);
    	    resto = B_izq % (A_der + 1);
    	}
    	else
    	{
    	    div = B_izq / A_der;
    	    resto = B_izq % A_der;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 2)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_der)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		if(b > 2)
            {
            	if(A_izq == 1)
                {
                	div = B_der / (A_izq + 1);
    	            resto = B_der % (A_izq + 1);
    	        }
    	        else
    	        {
    	        	div = B_der / A_izq;
    	            resto = B_der % A_izq;
    	        }

    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	if(div + resto > 2)
    			        {
    			        	r = 0;
    			        }
    			        else
    			        {
    			        	r = 1;
    			        }
    		        }
    		        else
    		        {
    		        	if(resto/2 < A_izq)
    			        {
    			        	r = 1;
    			        }
    			        else
    			        {
    			        	r = 0;
    			        }
    		        }
    	        }
    	        else
            	{
            		r = 0;
    	        }
            }
            else
            {
            	r = 0;
            }
    	}
    }
    else if(b >= -2 && b <= 2)
    {
    	if(b == -2)
    	{
    		r = 0;
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(b > 2)
    {
    	if(A_izq == 1)
        {
            div = B_der / (A_izq + 1);
    	    resto = B_der % (A_izq + 1);
    	}
    	else
    	{
    	    div = B_der / A_izq;
    	    resto = B_der % A_izq;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 2)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_izq)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(a < -2 || b < -2)
    {
    	r = 0;
    }

    return r;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		a = x;
		x = b;
		b = a;
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = x-b-1;
			if( ( c < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
}
	return z;
}

#include<stdio.h>
#include<stdlib.h>
#define M 200

int analizar_comodidad(int manoNinhaNinho[]);

main()
{
    int manos[4], comodo, i;

    for(i=0; i<4; i++)
    {
    	scanf("%d", &manos[i]);
    }

    comodo = analizar_comodidad(manos);

    if(comodo == 1)
    {
        printf("YES");
    }
	else
	{
        printf("NO");
    }

    return 0;
}

int analizar_comodidad(int manoNinhaNinho[]) // 1 es YES, 0 es NO
{
    int A_izq, A_der, B_izq, B_der, a, b, r, div, resto;

    A_izq = manoNinhaNinho[0];
    A_der = manoNinhaNinho[1];
    B_izq = manoNinhaNinho[2];
    B_der = manoNinhaNinho[3];

    a = B_izq - A_der;
    b = B_der - A_izq;

    if(a >= -2 && a <= 2)
    {
    	if(a == -2)
    	{
    		if(b >= -2 && b <= 2)
            {
            	if(b == -2)
    	        {
    		       r = 0;
    	        }
    	        else
    	        {
    		       r = 1;
    	        }
            }
            else if(b > 2)
            {
            	if(A_izq == 1)
            	{
            		div = B_der / (A_izq + 1);
    	            resto = B_der % (A_izq + 1);
    	        }
    	        else
    	        {
    	        	div = B_der / A_izq;
    	            resto = B_der % A_izq;
    	        }

    	        if(div <= 2)
    	        {
    	        	if(resto <= 2)
    		        {
    		        	if(div + resto > 2)
    			        {
    			        	r = 0;
    		 	        }
    			        else
    			        {
    			        	r = 1;
    			        }
    		        }
    		        else
    		        {
    			        if(resto/2 < A_izq)
    			        {
    			        	r = 1;
    			        }
    			        else
    			        {
    			        	r = 0;
    			        }
    		        }
    	        }
    	        else
    	        {
    		        r = 0;
    	        }
            }
            else if(b < -2)
            {
            	r = 0;
            }
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(a > 2 && (b <= -2 || b >= 2))
    {
    	if(A_der == 1)
        {
            div = B_izq / (A_der + 1);
    	    resto = B_izq % (A_der + 1);
    	}
    	else
    	{
    	    div = B_izq / A_der;
    	    resto = B_izq % A_der;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 2)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_der)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(b >= -2 && b <= 2)
    {
    	if(b == -2)
    	{
    		r = 0;
    	}
    	else
    	{
    		r = 1;
    	}
    }
    else if(b > 2)
    {
    	if(A_izq == 1)
        {
            div = B_der / (A_izq + 1);
    	    resto = B_der % (A_izq + 1);
    	}
    	else
    	{
    	    div = B_der / A_izq;
    	    resto = B_der % A_izq;
    	}

    	if(div <= 2)
    	{
    		if(resto <= 2)
    		{
    			if(div + resto > 2)
    			{
    				r = 0;
    			}
    			else
    			{
    				r = 1;
    			}
    		}
    		else
    		{
    			if(resto/2 < A_izq)
    			{
    				r = 1;
    			}
    			else
    			{
    				r = 0;
    			}
    		}
    	}
    	else
    	{
    		r = 0;
    	}
    }
    else if(a < -2 || b < -2)
    {
    	r = 0;
    }

    return r;
}

#include<stdio.h>

int main(){
	int gl, gr, bl, br;
	scanf("%d%d", &gl, &gr);
	scanf("%d%d", &bl, &br);
	if(br<gl || bl<gr){
		if(br==gl-1 || bl==gr-1){
			printf("YES");
		}else{
			printf("NO");
		}
	}else if(br>gl || bl>gr){
		if((2*gl+2)>=br || (2*gr+2)>=br){
			printf("YES");
		}else{
			printf("NO");
		}
	}else if(br==gl || bl==gr){
		printf("YES");
	}

}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(br,al) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			if( (2*b+2) >= x)
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	}
	return z;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(void) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    if ((abs(a - d) <= 1) || (d <= a * 2 + 2) || (abs(b - c) <= 1) || (c <= b * 2 + 2))
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(void) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    if (abs(a - d) < 4 || abs(b - c) < 4)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>

int main()
{
    int al,ar,bl,br;
    scanf("%d%d",&al,&ar);
    scanf("%d%d",&bl,&br);
    al-=1;
    ar-=1;
    if(br>=al)
    {
        if(br%2)
        {
            if(al>=((br/2)-1))
            {
                printf("YES\n");
                return 0;
            }
        }
        else if(al>=(br/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
        }
    }
    else if(bl>=ar)
    {
        if(bl%2)
        {
            if(ar>=((bl/2)-1))
            {
                printf("YES\n");
                return 0;
            }
        }
        else if(ar>=(bl/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
        }

    }

    else
    {
        printf("NO\n");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8

int mano_venus(char* venusString);
int mano_marte(char* marteString);
void comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];
    int hand_venus, hand_mars;

    gets(venus);
    gets(marte);

    hand_venus = mano_venus(venus);
    hand_mars = mano_marte(marte);

    if (hand_venus != -1 && hand_mars != -1)
    {
       comfortable(hand_venus, hand_mars);
    }

    return 0;
}

void comfortable(int venusiana, int marciano)
{
    if ((venusiana - marciano) == 0 || abs(venusiana - marciano) == 1)
    {
        printf("YES");
    }else{
        printf("NO");
    }
}

int mano_venus(char* venusString)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);

    char* manoVenusIzq = strtok(venusString, " ");
    char* manoVenusDer = strtok(NULL, " ");

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)
        {
            return atoi(manoVenusIzq);
        }
    }

    return -1;
}

int mano_marte(char* marteString)
{
    char* manoMarteIzq = strtok(marteString, " ");
    char* manoMarteDer = strtok(NULL, " ");

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) < 100)
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) < 100)
        {
            return atoi(manoMarteDer);
        }
    }

    return -1;
}

#include<stdio.h>
#include<math.h>
void ver(int mujeri,int mujerd,int machoi,int machod);
int main()
{
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    ver(a,b,c,d);
    return 0;
}
void ver(int mujeri,int mujerd,int machoi,int machod)
{
    if(machod>=mujeri && (machod-mujeri)-1<3 || machoi>=mujerd && (machoi-mujerd)-1<3 || mujerd-machoi==1 || mujeri-machod==1 || machod<=2+mujeri*2 || machoi<=2+mujerd*2)printf("YES");
    else printf("NO");
}

#include<stdio.h>
int main(){
int bl,br,gl,gr;
scanf("%d%d",&bl,&br);
scanf("%d%d",&gl,&gr);
if(bl>=gr+1&&bl<=(2*gr+2))
printf("YES\n");
else if(br>=gl+1&&br<=(2*gl+2))
printf("YES\n");
else printf("NO\n");
return 0;
}

#include<stdio.h>
#include<stdlib.h>

int analizar_comodidad(int izq_venu, int der_venu, int izq_mar, int der_mar);

main()
{
    int izq_venu, der_venu, izq_mar, der_mar, comodo;

    scanf("%d %d", &izq_venu, &der_venu);
    scanf("%d %d", &izq_mar, &der_mar);

    comodo = analizar_comodidad(izq_venu, der_venu, izq_mar, der_mar);

    if(comodo == 1)
    {
        printf("YES");
    }else{
        printf("NO");
    }

    return 0;
}

int analizar_comodidad(int izq_venu, int der_venu, int izq_mar, int der_mar) // 1 es YES, 0 es NO
{
    int r, a, b;

    a = izq_mar - der_venu;
    b = der_mar - izq_venu;

    if(a >= -2 && a <= 2)
    {
    	r = 1;
    }
    else if(b >= -2 && b <= 2)
    {
    	r = 1;
    }
    else
    {
    	r = 0;
    }

    return r;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &b_r, &b_l, &g_r, &g_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if(tot1<=3 || tot2<=3)
        printf("YES\n");

    else
        printf("NO\n");

    return 0;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &g_r, &g_l, &b_r, &b_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if((g_l-b_r<2 || b_r>g_l) && ((b_l / 2<=g_r)))
        printf("YES\n");

    else if((g_r-b_l<2 || b_l>g_r) && ((b_r / 2<= g_l)))
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include<stdio.h>

int main()
{
 char a[101],b[101];
 scanf("%s",a);
 scanf("%s",b);
 int i=0;
 while(a[i]&&b[i])
 {if(a[i]==b[i])
  printf("0");
  else
  printf("1");

  i++;
 }
}

#include<stdio.h>
#include<math.h>
void ver(int mujeri,int mujerd,int machoi,int machod);
int main()
{
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    ver(a,b,c,d);
    return 0;
}
void ver(int mujeri,int mujerd,int machoi,int machod)
{
    if(machod>=mujeri && (machod-mujeri)-2<3 || machoi>=mujerd && (machoi-mujerd)-2<3 || mujerd-machoi==1 || mujeri-machod==1 || machod==mujeri*2 || machoi==mujerd*2)printf("YES");
    else printf("NO");
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 8

int mano_venus(char* venusString, int num);
int mano_marte(char* marteString, int num);
int comfortable(int venusiana, int marciano);

int main(int argc, char const *argv[])
{
    char venus[MAX], marte[MAX];
    char auxVenus[MAX], auxMarte[MAX];

    int hand_venus, hand_mars;

    gets(venus); strcpy(auxVenus, venus);
    gets(marte); strcpy(auxMarte, marte);

    hand_venus = mano_venus(venus, 1);
    hand_mars = mano_marte(marte, 1);

   if (hand_venus != -1 && hand_mars != -1)
    {
        if(comfortable(hand_venus, hand_mars))
        {
            printf("YES");
        }else{
            hand_venus = mano_venus(auxVenus, 2);
            hand_mars = mano_marte(auxMarte, 2);
            if (comfortable(hand_venus, hand_mars))
            {
                printf("YES");
            }else{
                printf("NO");
            }
        }
    }

    return 0;
}

int comfortable(int venusiana, int marciano)
{
    int k = 0;

    if (((venusiana - marciano) == 0 || abs(venusiana - marciano) == 1) || (marciano - venusiana) > 0 || (marciano - venusiana) <= 3)
    {
        k = 1;
    }else{
        k = 0;
    }

    return k;
}

int mano_venus(char* venusString, int num)
{
    char auxVenus[MAX];
    strcpy(auxVenus, venusString);
    int k = -1;

    char* manoVenusIzq = strtok(venusString, " ");
    char* manoVenusDer = strtok(NULL, " ");

    if (atoi(manoVenusIzq) > 0 && atoi(manoVenusIzq) <= 100)
    {
        if (atoi(manoVenusDer) > 0 && atoi(manoVenusDer) <= 100)
        {
            if(num == 1)
            {
                k = atoi(manoVenusIzq);
            }else{
                k = atoi(manoVenusDer);
            }
        }
    }

    return k;
}

int mano_marte(char* marteString, int num)
{
    char* manoMarteIzq = strtok(marteString, " ");
    char* manoMarteDer = strtok(NULL, " ");
    int k = -1;

    if (atoi(manoMarteIzq) > 0 && atoi(manoMarteIzq) < 100)
    {
        if (atoi(manoMarteDer) > 0 && atoi(manoMarteDer) < 100)
        {
            if(num == 1)
            {
                k = atoi(manoMarteDer);
            }else{
                k = atoi(manoMarteIzq);
            }
        }
    }

    return k;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(br,al) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = 2*b+2;
			if( ( c >= x) )
				z=0;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	}
	return z;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( (abs(ar - bl) < 3) || (abs(al - br) < 3) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
int comfort(int girl, int boy){
    if(girl>boy){
        if(girl>=boy+2) return 0;
        else return 1;
    }
    else if(girl<boy){
        if((boy-1)-girl>=2) return 0;
        else return 1;
    }
    else return 1;
}

int main(void)
{
    int al, ar, bl, br;
    scanf("%d %d\n%d %d", &al,&ar,&bl,&br);
    if(comfort(al,br)==1 || comfort(ar,bl)==1) printf("YES");
    else printf("NO");
    return 0;
}

    /****************************
    *   Trabajo Practico Final  *
    *     A Student's Dream     *
    ****************************/
#include <stdio.h>

int main()
{
	long int venusiana_der,venusiana_izq,marsiano_der,marsiano_izq;

	//printf("Ingrese la cantidad de dedos de la venusiana en ambas manos\n");
	scanf("%ld %ld", &venusiana_der, &venusiana_izq);
	//printf("Ingrese la cantidad de dedos de la marisano en ambas manos\n");
	scanf("%ld %ld", &marsiano_der, &marsiano_izq);
	if(venusiana_der == marsiano_der && venusiana_izq == marsiano_izq)
        printf("SI");
	else if((marsiano_izq>=venusiana_der-1 && marsiano_izq<=(venusiana_der*2)+2) || (marsiano_der>=venusiana_izq-1 && marsiano_der<=(venusiana_izq*2)+2))
        printf("SI");
    else
        printf("NO");
    return 0;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(void) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    if ((a >= d && (a - d) < 2) || (d >= a && (d - a) < 3) || (b >= c && (b - c) < 2) || (c >= b && (c - b) < 3))
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#include<math.h>
int main(void) {
    int bl,br,gl,gr;
    scanf("%d %d %d %d",&gl,&gr,&bl,&br);
    if(abs(bl-gr)<2||abs(br-gl)<2)  printf("YES");
    else if(bl<=2*gr+2||br<=2*gl+2==2)  printf("YES");
    else    printf("NO");
    return 0;
}

#include<stdio.h>
#include<math.h>
void ver(int mujeri,int mujerd,int machoi,int machod);
int main()
{
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    ver(a,b,c,d);
    return 0;
}
void ver(int mujeri,int mujerd,int machoi,int machod)
{
    if(machod>=mujeri || machoi>=mujerd || (mujeri-machod)==1 || (mujerd-machoi)==1)
    {
        int a=abs(machod-mujeri);
        int b=abs(machoi-mujerd);
        if(a<3 || b<3) printf("YES");
        else printf("NO");
    }
    else printf("NO");
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		a = x;
		x = b;
		b = a;
		if(b == x-1)
		{
			z=1;
		}
	}
	else
	{
		if( x > b)
		{
			c = 2*b-1;
			if( ( c >= x ) || (x-b-1 < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
}
	return z;
}

#include<stdio.h>
#include<math.h>
void ver(int mujeri,int mujerd,int machoi,int machod);
int main()
{
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    ver(a,b,c,d);
    return 0;
}
void ver(int mujeri,int mujerd,int machoi,int machod)
{
    if(machod>=mujeri || machoi>=mujerd || (mujeri-machod)==1 || (mujerd-machoi)==1)
    {
        int a=abs(machod-mujeri)-1;
        int b=abs(machoi-mujerd)-1;
        if(a<3 || b<3) printf("YES");
        else printf("NO");
    }
    else printf("NO");
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = 2*b+2;
			if( ( c >= x ) || (x-b-1 < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
}
	return z;
}

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(void) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    if (abs(a - d) < 4 || abs(b - c) < 4)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>

int main()
{
    int al,ar,bl,br;
    scanf("%d%d",&al,&ar);
    scanf("%d%d",&bl,&br);
    al-=1;
    ar-=1;
    if(br>=al)
    {
        if((br%2)==0)
        {
            if(al>=((br/2)-1))
            {
                printf("YES\n");
                return 0;
            }
        }
        else if(al>=(br/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }
    }
    else if(bl>=ar)
    {
        if((bl%2)==0)
        {
            if(ar>=((bl/2)-1))
            {
                printf("YES\n");
                return 0;
            }
        }
        else if(ar>=(bl/2))
        {
            printf("YES\n");
            return 0;
        }
        else
        {
            printf("NO\n");
            return 0;
        }

    }

    else
    {
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &b_r, &b_l, &g_r, &g_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if(tot1<3 || tot2<3)
        printf("YES\n");

    else
        printf("NO\n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( (abs(ar / bl) < 3) || (abs(al / br) < 3) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>

int main()
{
	int a,b,c,d;
	scanf("%d %d",&a,&b);
	scanf("%d %d",&c,&d);
	if (d>=a-1 && d<=(a+3)){
		printf("YES");
	}
	else if(c>=b-1 && c<=(a+3)){
		printf("YES");
	}
	else{
		printf("NO");
	}
	return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
    int gr, gl, br, bl, i, a=0;
    scanf("%d %d", &gl, &gr);
    scanf("%d %d", &bl, &br);
    if(gl==br || bl==gr){
        printf("YES");
        return 0;
    }
    if(gl>br && (gl-br)<=1){
        printf("YES");
        return 0;
    }
    else if(gr>bl && (gr-bl)<=1){
        printf("YES");
        return 0;
    }
    if(br%2==0){
        br=br-1;
    }
    if(br>gl && gl>=(br/2)){
        printf("YES");
        return 0;
    }
    if(bl%2==0){
        bl=bl-1;
    }
    if(bl>gr && gr>=(bl/2)){
        printf("YES");
        return 0;
    }
    printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) || div1(br,al) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z;
	z=0;
	if(x < b)
	{
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			if( (2*b +2) >= x)
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	return z;
}

#include<stdio.h>
int main()
{ int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if((d>=a-1&&a>=d/2-1)||(c>=b-1&&b>=c/2-1))
 printf("YES");
 else
 printf("NO");
 return 0;
 }

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if( x < 100 && b < 100)
	{
	if(x < b)
	{
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = 2*b+2;
			if( ( c >= x && x-b-1 < 3) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
}
	return z;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) || div1(br,al) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z;
	z=1;
	if(x > b)
	{
		y = x / b;
		if(y > 3)
            z=0;
	}
	else
	{
		y = b / x;
        if(y > 3)
            z=0;
	}
	return z;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int ar, al, br, bl;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( (abs(ar - bl) < 3) || (abs(al - br) < 3) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if(x < b)
	{
		a = x;
		x = b;
		b = a;
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = 2*b+2;
			if( ( c >= x) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	return z;
}

    /****************************
    *   Trabajo Practico Final  *
    *     A Student's Dream     *
    ****************************/
#include <stdio.h>

int main()
{
	long int venusiana_der, venusiana_izq, marsiano_der, marsiano_izq;

	//printf("Ingrese la cantidad de dedos de la venusiana en ambas manos\n");
	scanf("%ld %ld", &venusiana_der, &venusiana_izq);
	//printf("Ingrese la cantidad de dedos de la marisano en ambas manos\n");
	scanf("%ld %ld", &marsiano_der, &marsiano_izq);

	if(venusiana_der == marsiano_der && venusiana_izq == marsiano_izq)
        printf("SI");
	else if((marsiano_izq>=venusiana_der-1 && marsiano_izq<=(venusiana_der*2)+2) || (marsiano_der>=venusiana_izq-1 && marsiano_der<=(venusiana_izq*2)+2))
        printf("SI");
    else
        printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( (abs(ar - bl) < 3) || (abs(al - br) < 3) )
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
#include <string.h>
int check_fing(int b, int g){
	int groups[102];
	int i;
	int correct = 1;
	memset(groups,0,102*sizeof(int));
	for(i = 0; b; i=(i+1)%(g+1)){
		groups[i]++;
		b--;
	}
	for(i = 0; i<g-1 && correct; i++)
		correct = (groups[i] > 0) && (groups[i]<=2);
	for(i = g; i<g+1 && correct; i++)
		correct = (groups[i] >= 0) && (groups[i]<=2);

	return correct;
}

int main(){
	int al, ar, bl, br;
	int res = 0;
	scanf("%d %d\n%d %d",&al,&ar,&bl,&br);
	res = check_fing(bl,ar) || check_fing(br,al);
	printf("%s\n", res ? "YES":"NO");
	return 0;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &g_r, &g_l, &b_r, &b_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if((g_l-b_r<2 || b_r>g_l) && ((b_l / 3<=g_r)))
        printf("YES\n");

    else if((g_r-b_l<2 || b_l>g_r) && ((b_r / 3<= g_l)))
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int div1(int x, int b);
int main()
{
	int ar, al, br, bl;
	ar = 0;
	al = 0;
	br = 0;
	bl = 0;
	scanf("%d%d",&ar, &al);
	scanf("%d%d",&br, &bl);
	if( div1(ar,bl) == 1 )
	{
		printf("YES");
	}
	else
	{
	    if( div1(al,br) == 1 )
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
	}
	return 0;
}
int div1(int x, int b)
{
	int y, z, c,a;
	z=0;
	if(x < b)
	{
		a = x;
		x = b;
		b = a;
		if(x == b-1)
			z=1;
	}
	else
	{
		if( x > b)
		{
			c = 2*b-1;
			if( ( c >= x) )
				z=1;
		}
		else
		{
			if ( x == b)
				z=1;
		}
	}
	return z;
}

#include<stdio.h>

int main()
{
    int b_r, b_l, g_r, g_l;

    scanf("%d %d %d %d", &g_r, &g_l, &b_r, &b_l);

    int tot1=abs(b_r - g_l);
    int tot2=abs(b_l - g_r);

    if(((b_l>=g_r) || tot2<=1) && ((b_l - g_r<3)))
        printf("YES\n");

    else if(((b_r>=g_l) || tot1<=1) && ((b_r - g_l<3)))
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include<stdio.h>
#include<stdlib.h>

int main()
{
    int gr, gl, br, bl, i, a=0;
    scanf("%d %d", &gl, &gr);
    scanf("%d %d", &bl, &br);
    if(gl==br || bl==gr){
        printf("YES");
        return 0;
    }
    if(gl<=br+1 && gl>=br){
        printf("YES");
        return 0;
    }
    else if(br>gl){
        if(br%2==1 && gl>=(br/2)){
            printf("YES");
        }
        else if(br%2==0 && gl>=(br/2)-1){
            printf("YES");
        }
        else{
            printf("NO");
        }
        return 0;
    }
    if(gr<=bl+1 && gr>=bl){
        printf("YES");
        return 0;
    }
    else if(bl>gr){
        if(bl%2==1 && gr>=(bl/2)){
            printf("YES");
        }
        else if(bl%2==0 && gr>=(bl/2)-1){
            printf("YES");
        }
        else{
            printf("NO");
        }
        return 0;
    }
    printf("NO");

    return 0;
}

#include<stdio.h>
int main()
{
    int a,b,c,d;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    if((d>=a-1&&d<2*a+1)||(c>=b-1&&c<2*b+1))
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

#include<stdio.h>
#include<math.h>
int main(){
	int f[2];
	int m[2];
	scanf("%d%d", &f[0], &f[1]);
	scanf("%d%d", &m[0], &m[1]);

	if( fabs(f[0]-m[1])<=1 || fabs(f[1]-m[0])<=1){
		printf("\nSI");
	}else{
		printf("\nNO");
	}
	return 0;
}

#include<stdio.h>

int main(){
	int gl, gr, bl, br;
	scanf("%d%d", &gl, &gr);
	scanf("%d%d", &bl, &br);
	if(br<gl || bl<gr){
		if(br==gl-1 || bl==gr-1){
			printf("YES");
		}else{
			printf("NO");
		}
	}else if(br>gl || bl>gr){
		if((gl==br/2-1 || gr==bl/2-1) || (gl==br/2 || gr==bl/2)){
			printf("YES");
		}else{
			printf("NO");
		}
	}else if(br==gl || bl==gr){
		printf("YES");
	}

}

#include<ctype.h>
#include<limits.h>
#include<math.h>
#include<stdbool.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void)
{
    int a1, a2, b1, b2;

    scanf("%d%d%d%d", &a1, &a2, &b1, &b2);

    if((a1 < b2 && (a1 + 1) * 2 >= b2)
        ||(a2 < b1 && (a2 + 1) * 2 >= b1))
        printf("YES");
    else
        printf("NO");

    return 0;
}