#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
} arr[8];
int Orientation(Point p1, Point p2, Point p3) {
  int val = ((p2.y - p1.y) * (p3.x - p2.x)) - ((p3.y - p2.y) * (p2.x - p1.x));
  if (val > 0) return 1;
  if (val < 0) return 2;
  if (val == 0) return 0;
}
bool Onsegment(Point p1, Point p2, Point p3) {
  if (p3.x <= max(p1.x, p2.x) and p3.x >= min(p1.x, p2.x) and
      p3.y <= max(p1.y, p2.y) and p3.y >= min(p1.y, p2.y))
    return true;
  return false;
}
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 and o3 != o4) return true;
  if (o1 == 0 and Onsegment(p1, q1, p2)) return true;
  if (o2 == 0 and Onsegment(p1, q1, q2)) return true;
  if (o3 == 0 and Onsegment(p2, q2, p1)) return true;
  if (o4 == 0 and Onsegment(p2, q2, q1)) return true;
  return false;
}
bool Insidesquare(Point p1, Point p2, Point p3, Point p4, Point p5, Point p6,
                  Point p7, Point p8) {
  int o1 = Orientation(p1, p2, p5);
  int o2 = Orientation(p1, p2, p6);
  int o3 = Orientation(p1, p2, p7);
  int o4 = Orientation(p1, p2, p8);
  int o5 = Orientation(p2, p3, p5);
  int o6 = Orientation(p2, p3, p6);
  int o7 = Orientation(p2, p3, p7);
  int o8 = Orientation(p2, p3, p8);
  int o9 = Orientation(p3, p4, p5);
  int o10 = Orientation(p3, p4, p6);
  int o11 = Orientation(p3, p4, p7);
  int o12 = Orientation(p3, p4, p8);
  int o13 = Orientation(p4, p1, p5);
  int o14 = Orientation(p4, p1, p6);
  int o15 = Orientation(p4, p1, p7);
  int o16 = Orientation(p4, p1, p8);
  if (o1 == o2 and o2 == o3 and o3 == o4 and o4 == o5 and o5 == o6 and
      o6 == o7 and o7 == o8 and o8 == o9 and o9 == o10 and o10 == o11 and
      o11 == o12 and o12 == o13 and o13 == o14 and o14 == o15 and o15 == o16)
    return true;
  return false;
}
int main() {
  for (int i = 0; i < 8; ++i) {
    int a, b;
    cin >> a >> b;
    arr[i].x = a;
    arr[i].y = b;
  }
  if (Insidesquare(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6],
                   arr[7]) == 1)
    cout << "YES" << endl;
  else if (Insidesquare(arr[4], arr[5], arr[6], arr[7], arr[0], arr[1], arr[2],
                        arr[3]))
    cout << "YES" << endl;
  else {
    if (doIntersect(arr[0], arr[1], arr[4], arr[5]))
      cout << "YES" << endl;
    else if (doIntersect(arr[0], arr[1], arr[5], arr[6]))
      cout << "YES" << endl;
    else if (doIntersect(arr[0], arr[1], arr[6], arr[7]))
      cout << "YES" << endl;
    else if (doIntersect(arr[0], arr[1], arr[7], arr[4]))
      cout << "YES" << endl;
    else if (doIntersect(arr[1], arr[2], arr[4], arr[5]))
      cout << "YES" << endl;
    else if (doIntersect(arr[1], arr[2], arr[5], arr[6]))
      cout << "YES" << endl;
    else if (doIntersect(arr[1], arr[2], arr[6], arr[7]))
      cout << "YES" << endl;
    else if (doIntersect(arr[1], arr[2], arr[7], arr[4]))
      cout << "YES" << endl;
    else if (doIntersect(arr[2], arr[3], arr[4], arr[5]))
      cout << "YES" << endl;
    else if (doIntersect(arr[2], arr[3], arr[5], arr[6]))
      cout << "YES" << endl;
    else if (doIntersect(arr[2], arr[3], arr[6], arr[7]))
      cout << "YES" << endl;
    else if (doIntersect(arr[2], arr[3], arr[7], arr[4]))
      cout << "YES" << endl;
    else if (doIntersect(arr[3], arr[0], arr[4], arr[5]))
      cout << "YES" << endl;
    else if (doIntersect(arr[3], arr[0], arr[5], arr[6]))
      cout << "YES" << endl;
    else if (doIntersect(arr[3], arr[0], arr[6], arr[7]))
      cout << "YES" << endl;
    else if (doIntersect(arr[3], arr[0], arr[7], arr[4]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
