#include <bits/stdc++.h>
const long long int INF = 2e9, MOD = 1e9 + 7;
const long double eps = 0.001;
using namespace std;
class point {
 public:
  double first, second;
  int i;
  point(double _x, double _y) {
    first = _x;
    second = _y;
  }
  point() { point(0, 0); }
};
class line {
 public:
  double a, b, c;
  line(double _a = 0, double _b = 0, double _c = 0) {
    a = _a;
    b = _b;
    c = _c;
  }
};
double area_triangle(point a, point b, point c) {
  return 0.5 * (a.first * b.second + b.first * c.second + c.first * a.second -
                a.second * b.first - b.second * c.first - c.second * a.first);
}
line toline(point p1, point p2) {
  double a = p2.second - p1.second;
  double b = p1.first - p2.first;
  return line(a, b, -a * p1.first - b * p1.second);
}
int point_in_line(line l, point p) {
  double s = l.a * p.first + l.b * p.second + l.c;
  return s < -eps ? -1 : s > eps ? 1 : 0;
}
bool point_in_box(point t, point p1, point p2) {
  return (abs(t.first - min(p1.first, p2.first)) <= eps ||
          min(p1.first, p2.first) <= t.first) &&
         (abs(max(p1.first, p2.first) - t.first) <= eps ||
          max(p1.first, p2.first) >= t.first) &&
         (abs(t.second - min(p1.second, p2.second)) <= eps ||
          min(p1.second, p2.second) <= t.second) &&
         (abs(max(p1.second, p2.second) - t.second) <= eps ||
          max(p1.second, p2.second) >= t.second);
}
bool is_cross_segment(point p1, point p2, point p3, point p4) {
  line l1 = toline(p1, p2);
  line l2 = toline(p3, p4);
  int sign1 = point_in_line(l1, p3) * point_in_line(l1, p4);
  int sign2 = point_in_line(l2, p1) * point_in_line(l2, p2);
  if (abs(sign1) <= eps && abs(sign2) <= eps)
    return point_in_box(p1, p3, p4) || point_in_box(p2, p3, p4) ||
           point_in_box(p3, p1, p2) || point_in_box(p4, p1, p2);
  return sign1 <= eps && sign2 <= eps;
}
point min_py(point a, point b) {
  return a.second < b.second ||
                 (abs(a.second - b.second) <= eps && a.first < b.first)
             ? a
             : b;
}
point max_py(point a, point b) {
  return a.second > b.second ||
                 (abs(a.second - b.second) <= eps && a.first > b.first)
             ? a
             : b;
}
bool ccw(point a, point b, point c) { return area_triangle(a, b, c) > eps; }
bool point_in_polygon(point t, vector<point> p) {
  int i, j;
  int count = 0;
  for (i = 0; i < p.size(); ++i) {
    j = (i + 1) % p.size();
    if (min(p[i].second, p[j].second) < t.second &&
        t.second <= max(p[i].second, p[j].second) &&
        ccw(min_py(p[i], p[j]), max_py(p[i], p[j]), t)) {
      ++count;
    }
  }
  return count % 2;
}
int main() {
  vector<point> a(4);
  vector<point> b(4);
  for (int i = 0; i < 4; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> b[i].first >> b[i].second;
  }
  if (point_in_polygon(a[0], b)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(a[1], b)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(a[2], b)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(a[3], b)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(b[0], a)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(b[1], a)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(b[2], a)) {
    cout << "YES";
    return 0;
  }
  if (point_in_polygon(b[3], a)) {
    cout << "YES";
    return 0;
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (is_cross_segment(a[i], a[(i + 1) % 4], b[j], b[(j + 1) % 4])) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
