#include <bits/stdc++.h>
using namespace std;
int main() {
  int flag = 0;
  double r;
  vector<double> v;
  double xa, ya, xb, yb, xc, yc, xd, yd;
  cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
  double minx = min(min(min(xa, xb), xc), xd);
  double miny = min(min(min(ya, yb), yc), yd);
  double maxx = max(max(max(xa, xb), xc), xd);
  double maxy = max(max(max(ya, yb), yc), yd);
  double xe, ye, xf, yf, xg, yg, xh, yh;
  cin >> xe >> ye >> xf >> yf >> xg >> yg >> xh >> yh;
  double x, y;
  double mi = min(min(min(ye, yf), yg), yh);
  double ma = max(max(max(ye, yf), yg), yh);
  double sumx = xe + xf + xg + xh, sumy = ye + yf + yg + yh;
  sumy = sumy - mi - ma;
  sumy /= 2;
  if (ye == mi || ye == ma) sumx -= xe;
  if (yf == mi || yf == ma) sumx -= xf;
  if (yg == mi || yg == ma) sumx -= xg;
  if (yh == mi || yh == ma) sumx -= xh;
  sumx /= 2;
  if (ye == sumy) v.push_back(xe);
  if (yf == sumy) v.push_back(xf);
  if (yg == sumy) v.push_back(xg);
  if (yh == sumy) v.push_back(xh);
  r = fabs(v[0] - v[1]) / 2;
  if (sumx >= minx - r && sumx <= maxx + r && sumy >= miny - r &&
      sumy <= maxy + r)
    flag = 1;
  if (sumx >= minx - r && sumx <= minx && sumy >= maxy &&
      (maxy + sumx - (minx - r)) < sumy)
    flag = 0;
  if (sumx >= minx - r && sumx <= minx && sumy <= miny &&
      (miny - (sumx - (minx - r))) > sumy)
    flag = 0;
  if (sumx >= maxx && sumx <= maxx + r && sumy >= maxy &&
      (maxy + (maxx + r) - sumx) < sumy)
    flag = 0;
  if (sumx >= maxx && sumx <= maxx + r && sumy <= miny &&
      (miny - ((maxx + r) - sumx)) > sumy)
    flag = 0;
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
