#include <bits/stdc++.h>
using namespace std;
struct fPoint {
  double x, y;
};
double area(double x1, double y1, double x2, double y2, double x3, double y3) {
  return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
}
bool PointInTriangle(fPoint x, fPoint x1, fPoint x2, fPoint x3) {
  double A = area(x1.x, x1.y, x2.x, x2.y, x3.x, x3.y);
  double A1 = area(x.x, x.y, x2.x, x2.y, x3.x, x3.y);
  double A2 = area(x1.x, x1.y, x.x, x.y, x3.x, x3.y);
  double A3 = area(x1.x, x1.y, x2.x, x2.y, x.x, x.y);
  return (A == A1 + A2 + A3);
}
fPoint n1, n2, n3, n4, o1, o2, o3, o4, no, oo;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n1.x >> n1.y >> n2.x >> n2.y >> n3.x >> n3.y >> n4.x >> n4.y >> o1.x >>
      o1.y >> o2.x >> o2.y >> o3.x >> o3.y >> o4.x >> o4.y;
  no.x = (n1.x + n2.x + n3.x + n4.x) / 4.0;
  no.y = (n1.y + n2.y + n3.y + n4.y) / 4.0;
  oo.x = (o1.x + o2.x + o3.x + o4.x) / 4.0;
  oo.y = (o1.y + o2.y + o3.y + o4.y) / 4.0;
  bool ans = false;
  if (PointInTriangle(o1, n1, n2, n3)) ans = true;
  if (PointInTriangle(o2, n1, n2, n3)) ans = true;
  if (PointInTriangle(o3, n1, n2, n3)) ans = true;
  if (PointInTriangle(o4, n1, n2, n3)) ans = true;
  if (PointInTriangle(oo, n1, n2, n3)) ans = true;
  if (PointInTriangle(o1, n2, n3, n4)) ans = true;
  if (PointInTriangle(o2, n2, n3, n4)) ans = true;
  if (PointInTriangle(o3, n2, n3, n4)) ans = true;
  if (PointInTriangle(o4, n2, n3, n4)) ans = true;
  if (PointInTriangle(oo, n2, n3, n4)) ans = true;
  if (PointInTriangle(o1, n3, n4, n1)) ans = true;
  if (PointInTriangle(o2, n3, n4, n1)) ans = true;
  if (PointInTriangle(o3, n3, n4, n1)) ans = true;
  if (PointInTriangle(o4, n3, n4, n1)) ans = true;
  if (PointInTriangle(oo, n3, n4, n1)) ans = true;
  if (PointInTriangle(o1, n4, n1, n2)) ans = true;
  if (PointInTriangle(o2, n4, n1, n2)) ans = true;
  if (PointInTriangle(o3, n4, n1, n2)) ans = true;
  if (PointInTriangle(o4, n4, n1, n2)) ans = true;
  if (PointInTriangle(oo, n4, n1, n2)) ans = true;
  if (PointInTriangle(n1, o1, o2, o3)) ans = true;
  if (PointInTriangle(n2, o1, o2, o3)) ans = true;
  if (PointInTriangle(n3, o1, o2, o3)) ans = true;
  if (PointInTriangle(n4, o1, o2, o3)) ans = true;
  if (PointInTriangle(no, o1, o2, o3)) ans = true;
  if (PointInTriangle(n1, o2, o3, o4)) ans = true;
  if (PointInTriangle(n2, o2, o3, o4)) ans = true;
  if (PointInTriangle(n3, o2, o3, o4)) ans = true;
  if (PointInTriangle(n4, o2, o3, o4)) ans = true;
  if (PointInTriangle(no, o2, o3, o4)) ans = true;
  if (PointInTriangle(n1, o3, o4, o1)) ans = true;
  if (PointInTriangle(n2, o3, o4, o1)) ans = true;
  if (PointInTriangle(n3, o3, o4, o1)) ans = true;
  if (PointInTriangle(n4, o3, o4, o1)) ans = true;
  if (PointInTriangle(no, o3, o4, o1)) ans = true;
  if (PointInTriangle(n1, o4, o1, o2)) ans = true;
  if (PointInTriangle(n2, o4, o1, o2)) ans = true;
  if (PointInTriangle(n3, o4, o1, o2)) ans = true;
  if (PointInTriangle(n4, o4, o1, o2)) ans = true;
  if (PointInTriangle(no, o4, o1, o2)) ans = true;
  if (ans)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
