/* AKSHAT SHARMA */
#include <iostream>
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define ll long long
#define li long int
#define MOD 1000000007
#define MAX 1000000001
#define rep(i,a,b) for(i=a;i<b;i++)
#define reqp(i,a,b) for(i=a;i<=b;i++)
#define ren for(i=0;i<n;i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef pair<li,li>pii;
li arr[4][2],brr[4][2];
double s1,s2;
void getLine(double x1, double y1, double x2, double y2, double &a, double &b, double &c)
{
// (x- p1X) / (p2X - p1X) = (y - p1Y) / (p2Y - p1Y)
a = y2 - y1;
b = x2 - x1;
c = x1 * y2 - x2 * y1;
}
double dist1(double pct1X, double pct1Y, double pct2X, double pct2Y, double pct3X, double pct3Y)
{
double a, b, c;
getLine(pct2X, pct2Y, pct3X, pct3Y, a, b, c);
return abs(a * pct1X + b * pct1Y + c) / sqrt(a * a + b * b);
}
double dist(li x,li y,li a,li b){
double t1,t2;
t1=(x-a);
t2=(y-b);
return sqrt(t1*t1*1.0+t2*t2*1.0);
}
void check(li x,li y){
li i;
double a,b;
int flag=0;
rep(i,0,4){
if(dist1(x*1.0,y*1.0,arr[i][0],arr[i][1],arr[(i+1)%4][0],arr[(i+1)%4][1])-s1>DBL_EPSILON)
return ;
}
rep(i,0,4){
if(dist1(x*1.0,y*1.0,brr[i][0],brr[i][1],brr[(i+1)%4][0],brr[(i+1)%4][1])-s2>DBL_EPSILON)
return;
}
// cout<<x<<" "<<y<<"\n";
cout<<"YES";
exit(0);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input_file.txt", "r", stdin);
//freopen("output_file.txt", "w", stdout);
#endif
li i,j,k,l,n,test_case;
test_case=1;
//cin>>test_case;
while(test_case--){
map<pii,int>m;
li cnt=0;
rep(i,0,4){
cin>>arr[i][0]>>arr[i][1];
m[mp(arr[i][0],arr[i][1])]=1;
}
s1=dist(arr[0][0],arr[0][1],arr[1][0],arr[1][1]);
rep(i,0,4){
cin>>brr[i][0]>>brr[i][1];
rep(j,0,4){
if(abs(dist(arr[j][0],arr[j][1],brr[i][0],brr[i][1])+dist(arr[(j+1)%4][0],arr[(j+1)%4][1],brr[i][0],brr[i][1])-s1)<DBL_EPSILON){
cout<<"YES";
return 0;
}
}
if(m[mp(brr[i][0],brr[i][1])]==1)
cnt++;
}
s2=dist(brr[0][0],brr[0][1],brr[1][0],brr[1][1]);
// cout<<"SSDDKJDKJD\n";
// cout<<s1<<" "<<s2<<"...\n\n\n";
rep(i,0,4){
//cin>>brr[i][0]>>brr[i][1];
rep(j,0,4){
if(abs(dist(brr[j][0],brr[j][1],arr[i][0],arr[i][1])+dist(brr[(j+1)%4][0],brr[(j+1)%4][1],arr[i][0],arr[i][1])-s2)<DBL_EPSILON){
cout<<"YES";
return 0;
}
}
//
}
if(cnt==1){
cout<<"YES";
}else{
for(i=-100;i<=100;i++){
for(j=-100;j<=100;j++){
check(i,j);
}
}
}
cout<<"NO\n";
}
return 0;
}
LyogQUtTSEFUIFNIQVJNQSAqLwojaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgojZGVmaW5lIElPUyAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSksIGNpbi50aWUoMCksIGNvdXQudGllKDApCiNkZWZpbmUgbXAgICBtYWtlX3BhaXIKI2RlZmluZSBwYiAgIHB1c2hfYmFjawojZGVmaW5lIEYgICAgZmlyc3QKI2RlZmluZSBTICAgIHNlY29uZAojZGVmaW5lIGxsICAgbG9uZyBsb25nCiNkZWZpbmUgbGkgICBsb25nIGludAojZGVmaW5lIE1PRCAgMTAwMDAwMDAwNwojZGVmaW5lIE1BWCAgMTAwMDAwMDAwMQojZGVmaW5lIHJlcChpLGEsYikgZm9yKGk9YTtpPGI7aSsrKQojZGVmaW5lIHJlcXAoaSxhLGIpIGZvcihpPWE7aTw9YjtpK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