#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int SZ = 200010, INF = 0x7FFFFFFF;
const double EPS = 1e-10;
struct Point {
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
};
Point operator-(Point A, Point B) { return Point(A.x - B.x, A.y - B.y); }
Point operator*(Point A, double p) { return Point(A.x * p, A.y * p); }
int dcmp(double x) {
  if (fabs(x) < EPS)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
bool operator==(const Point &a, const Point &b) {
  return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) == 0;
}
double Dot(Point A, Point B) { return A.x * B.x + A.y * B.y; }
double Length(Point A) { return sqrt(Dot(A, A)); }
double Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
bool OnSegment(Point P, Point a1, Point a2) {
  if (P == a1 || P == a2) return 1;
  return dcmp(Cross(a1 - P, a2 - P)) == 0 && dcmp(Dot(a1 - P, a2 - P)) < 0;
}
bool SegmentProperIntersection(Point a1, Point a2, Point b1, Point b2) {
  if (a1 == b1 || a1 == b2) return 1;
  double c1 = Cross(a2 - a1, b1 - a1), c2 = Cross(a2 - a1, b2 - a1);
  double c3 = Cross(b2 - b1, a1 - b1), c4 = Cross(b2 - b1, a2 - b1);
  return dcmp(c1) * dcmp(c2) < 0 && dcmp(c3) * dcmp(c4) < 0;
}
int isPointInPolygon(Point p, vector<Point> poly) {
  int wn = 0;
  int n = poly.size();
  for (int i = 0; i < n; i++) {
    if (OnSegment(p, poly[i], poly[(i + 1) % n])) return -1;
    int k = dcmp(Cross(poly[(i + 1) % n] - poly[i], p - poly[i]));
    int d1 = dcmp(poly[i].y - p.y);
    int d2 = dcmp(poly[(i + 1) % n].y - p.y);
    if (k > 0 && d1 <= 0 && d2 > 0) wn++;
    if (k < 0 && d2 <= 0 && d1 > 0) wn--;
  }
  if (wn != 0) return 1;
  return 0;
}
bool one_point_inside(vector<Point> &x, vector<Point> &y) {
  for (int i = 0; i < x.size(); ++i) {
    if (isPointInPolygon(x[i], y) != 0) return 1;
  }
  return 0;
}
void work(vector<Point> &one, vector<Point> &two) {
  bool ok = 0;
  ok |= one_point_inside(one, two);
  ok |= one_point_inside(two, one);
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      ok |= SegmentProperIntersection(one[i], one[(i + 1) % 4], two[j],
                                      two[(j + 1) % 4]);
    }
  }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  std::ios::sync_with_stdio(0);
  {
    vector<Point> one, two;
    for (int i = 0; i < 4; ++i) {
      double tmp1, tmp2;
      cin >> tmp1 >> tmp2;
      one.push_back(Point(tmp1, tmp2));
    }
    for (int i = 0; i < 4; ++i) {
      double tmp1, tmp2;
      cin >> tmp1 >> tmp2;
      two.push_back(Point(tmp1, tmp2));
    }
    work(one, two);
  }
  return 0;
}
