#include<stdio.h>
#include<limits.h>
#include<math.h>
struct point
{
	float x1;
	float y1;
};

float findratio(float x,float y, struct point *a)
{
	if(x!=a[0].x1)
	{
	return (a[1].x1-x)/(x-a[0].x1);	
	}
	else 
	{
	return (a[1].y1-y)/(y-a[0].y1);
	}	
}
float findratioSlopesame(struct point * a, struct point* b)
{
	float m;
	m=findratio(a[0].x1,a[0].y1,b);
	if(m>0)
	return m;
	m=findratio(a[1].x1,a[1].y1,b);
	if(m>0)
	return m;
	m=findratio(b[0].x1,b[0].y1,a);
	if(m>0)
	return m;
	m=findratio(b[0].x1,b[0].y1,a);
	if(m>0)
	return m;
	return -1;
	
}
float findslope(struct point *a)
{
	if(a[0].x1==a[1].x1)
	{
		return INFINITY;
	}
	else
	{
		return (a[1].y1-a[0].y1)/(a[1].x1-a[0].x1);
	}
}
int check (struct point *a, struct point *b)
{
	if((a[0].y1<=b[0].y1&& a[0].y1>=b[1].y1)||(a[1].y1<=b[0].y1&& a[1].y1>=b[1].y1) )
	return 1;
	else if((a[0].y1<=b[1].y1&& a[0].y1>=b[0].y1)||(a[1].y1<=b[1].y1&& a[1].y1>=b[0].y1) )
	return 1;
	return 0;
}
int intersection(struct point *a, struct point *b,struct point *p)
{
float m1=findslope(a);
float m2=findslope(b);

if(m1==INFINITY && m2==INFINITY)
{

	if(a[0].x1==b[1].x1)
	{
		//check whether 1st line contains another line 

		if(check(a,b)||check(b,a))
		{
			return 1;
		}
	}
	else
	{
		p->x1=INFINITY;
		p->y1=INFINITY;
		return 0;
	}

}

else if (m1!=INFINITY && m2!=INFINITY && m1!=m2)
{

	float x=(b[0].y1-a[0].y1-(m2*b[0].x1)+(m1*a[0].x1))/(m1-m2);
	float y=a[0].y1+m1*(x-a[0].x1);
	p->x1=x;
	p->y1=y;
	if(findratio(x,y,a)>=0 && findratio(x,y,b)>=0)
	return 1;
	else 
	return 0;
	
} 
else if (m1==m2)
{
	//y=mx+c1 y=mx+c2 checking c1-c2
	float x=a[0].y1-m1*a[0].x1;
	float y=b[0].y1-m1*b[0].x1;
	if(x!=y)
	return 0;
	if((a[0].x1==b[0].x1 && a[0].y1==b[0].y1)||(a[1].x1==b[0].x1 && a[1].y1==b[0].y1)||(a[0].x1==b[1].x1 && a[0].y1==b[1].y1)||(a[1].x1==b[1].x1 && a[1].y1==b[1].y1))
	return 1;
 	if(findratioSlopesame(a,b)>0||findratioSlopesame(b,a)>0)
	return 1;
	return 0;
}
else if(m1!=m2)
{
	if(m1==INFINITY)
	{
	
		float x=a[0].x1;
		float y=b[0].y1+m2*(x-b[0].x1);
		if((x==a[0].x1&& y==a[0].y1)||(x==a[1].x1&& y==a[1].y1)||(x==b[0].x1&& y==b[0].y1)||(x==b[1].x1&& y==b[1].y1))
		{
			return 1;
		}
		if(findratio(x,y,a)>0|| findratio(x,y,b)>0)
		return 1;
		else 
		return 0;
	}
	else if (m2==INFINITY)
	{
		float x=b[0].x1;
		float y=a[0].y1+m1*(x-a[0].x1);
		if((x==a[0].x1&& y==a[0].y1)||(x==a[1].x1&& y==a[1].y1)||(x==b[0].x1&& y==b[0].y1)||(x==b[1].x1&& y==b[1].y1))
		{
			return 1;
		}
		if(findratio(x,y,a)>0|| findratio(x,y,b)>0)
		return 1;
		else 
		return 0;
	}
	
}
		
}


int main()
{
	struct point l1[2];
	struct point l2[2];
	scanf("%f %f %f %f",&l1[0].x1,&l1[0].y1,&l1[1].x1,&l1[1].y1);
	
	scanf("%f %f %f %f",&l2[0].x1,&l2[0].y1,&l2[1].x1,&l2[1].y1);
	//findintersection
	// tells the 
	struct point p;
	int result=intersection(l1,l2,&p);
	if(result==0)
	{
		printf("\nNo");
	}
	else
	{
			printf("\nYes");
	}
	return 0;
}