#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x;
  long long 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;
}
long long orientation(Point p, Point q, Point r) {
  long long 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) {
  long long o1 = orientation(p1, q1, p2);
  long long o2 = orientation(p1, q1, q2);
  long long o3 = orientation(p2, q2, p1);
  long long 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;
}
void solve() {
  long long x, y;
  vector<Point> p1(4), p2(4);
  for (long long j = 0; j < 4; j++) {
    cin >> x >> y;
    p1[j].x = x;
    p1[j].y = y;
  }
  for (long long j = 0; j < 4; j++) {
    cin >> x >> y;
    p2[j].x = x;
    p2[j].y = y;
  }
  for (long long i = 0; i < 4; i++) {
    for (long long j = i + 1; j < 4; j++) {
      for (long long k = 0; k < 4; k++) {
        for (long long l = k + 1; l < 4; l++) {
          bool t = doIntersect(p1[i], p1[j], p2[k], p2[l]);
          if (t == true) {
            cout << "YES";
            return;
          }
        }
      }
    }
  }
  cout << "NO";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
