#include <bits/stdc++.h>
using namespace std;
const int INFTY = 20000000;
const int MAX = 500100;
const int MOD = 10000000;
void coutTab(int* tab, int n) {
  for (int i = 0; i < n; i++) {
    cout << tab[i] << " ";
  }
  cout << "\n";
}
struct point {
  int x, y;
};
struct sq {
  point p[5];
};
long long prod(point p1, point p2, point p3) {
  return (p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x);
}
bool onSegment(point p1, point p2, point p3) {
  if (prod(p1, p2, p3) == 0 && min(p1.x, p2.x) <= p3.x &&
      max(p1.x, p2.x) >= p3.x && min(p1.y, p2.y) <= p3.y &&
      max(p1.y, p2.y) >= p3.y)
    return true;
  return false;
}
bool intersect(point p1, point p2, point p3, point p4) {
  if (prod(p1, p2, p3) * prod(p1, p2, p4) < 0 &&
      prod(p3, p4, p1) * prod(p3, p4, p2) < 0)
    return true;
  else if (onSegment(p1, p2, p3) || onSegment(p1, p2, p4) ||
           onSegment(p3, p4, p1) || onSegment(p3, p4, p2))
    return true;
  return false;
}
bool intersectsq(sq a, sq b) {
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (intersect(a.p[i], a.p[i + 1], b.p[j], b.p[j + 1])) return true;
      ;
    }
  }
  return false;
}
bool contains(sq a, sq b) {
  bool exists = false;
  for (int i = 0; i < 4; i++) {
    bool all = true;
    long long last = 0;
    for (int j = 0; j < 4; j++) {
      long long pd = prod(a.p[j], a.p[j + 1], b.p[i]);
      if (pd * last < 0) all = false;
      if (pd != 0) last = pd;
    }
    if (all) exists = true;
  }
  return exists;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  sq a, b;
  cin >> a.p[0].x >> a.p[0].y >> a.p[1].x >> a.p[1].y >> a.p[2].x >> a.p[2].y >>
      a.p[3].x >> a.p[3].y;
  cin >> b.p[0].x >> b.p[0].y >> b.p[1].x >> b.p[1].y >> b.p[2].x >> b.p[2].y >>
      b.p[3].x >> b.p[3].y;
  a.p[4] = a.p[0];
  b.p[4] = b.p[0];
  if (contains(a, b) || contains(b, a) || intersectsq(a, b))
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
