#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x;
  int y;
};
bool onSegment(Point p, Point q, Point r) {
  if (q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) &&
      q.y >= min(p.y, r.y))
    return true;
  return false;
}
int orientation(Point p, Point q, Point r) {
  int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
bool doIntersect(Point p1, Point q1, Point p2, Point q2) {
  int o1 = orientation(p1, q1, p2);
  int o2 = orientation(p1, q1, q2);
  int o3 = orientation(p2, q2, p1);
  int o4 = orientation(p2, q2, q1);
  if (o1 != o2 && o3 != o4) return true;
  if (o1 == 0 && onSegment(p1, p2, q1)) return true;
  if (o2 == 0 && onSegment(p1, q2, q1)) return true;
  if (o3 == 0 && onSegment(p2, p1, q2)) return true;
  if (o4 == 0 && onSegment(p2, q1, q2)) return true;
  return false;
}
vector<Point> v;
vector<Point> v1;
int main() {
  Point A1, B1, C1, D1, A, B, C, D;
  cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> D.x >> D.y;
  cin >> A1.x >> A1.y >> B1.x >> B1.y >> C1.x >> C1.y >> D1.x >> D1.y;
  v.push_back(A);
  v.push_back(B);
  v.push_back(C);
  v.push_back(D);
  v1.push_back(A1);
  v1.push_back(B1);
  v1.push_back(C1);
  v1.push_back(D1);
  for (int i = 0; i < v.size() - 1; i++)
    for (int j = i + 1; j < v.size(); j++) {
      for (int i1 = 0; i1 < v1.size() - 1; i1++)
        for (int j1 = i1 + 1; j1 < v1.size(); j1++) {
          if (doIntersect(v[i], v[j], v1[i1], v1[j1])) {
            cout << "YES\n";
            return 0;
          }
        }
    }
  cout << "NO\n";
  return 0;
}
