#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int llINF = 0x3f3f3f3f3f3f3f;
struct point {
  int x, y;
  point() {}
  point(int a, int b) { x = a, y = b; }
  point operator-(point p) { return {x - p.x, y - p.y}; }
  int operator*(point p) { return x * p.x + y * p.y; }
  int operator^(point p) { return x * p.y - y * p.x; }
};
struct segment {
  point p, q;
  segment() {}
  segment(point a, point b) { p = a, q = b; }
  bool inside(point r) {
    if ((r - p) * (q - p) < 0 || (r - q) * (p - q) < 0) return false;
    if ((r - p) ^ (q - p)) return false;
    return true;
  }
  int ori(point a, point b, point c) {
    int dot = (a - b) ^ (c - b);
    if (dot) dot /= abs(dot);
    return dot;
  }
  bool intersect(segment s) {
    if (inside(s.p) || inside(s.q)) return true;
    if (((p - q) ^ (s.p - s.q)) == 0) return false;
    return ori(p, s.q, q) != ori(p, s.p, q) &&
           ori(s.p, q, s.q) != ori(s.p, p, s.q);
  }
};
bool inside(vector<point>& v, vector<point>& s) {
  for (int i = 0; i < 4; i++) {
    point r = v[i];
    bool neg = false, pos = false;
    for (int j = 0; j < 4; j++) {
      point p = s[j];
      point q = s[(j + 1) % 4];
      int dot = (p - r) ^ (q - p);
      if (dot >= 0) pos |= 1;
      if (dot < 0) neg |= 1;
    }
    if (!(neg & pos)) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<point> sqr1, sqr2;
  int n = 4;
  for (int i = 0; i < 4; i++) {
    int x, y;
    cin >> x >> y;
    sqr1.push_back(point(x, y));
  }
  for (int i = 0; i < 4; i++) {
    int x, y;
    cin >> x >> y;
    sqr2.push_back(point(x, y));
  }
  vector<segment> s1, s2;
  for (int i = 0; i < 4; i++) {
    segment aux = segment(sqr1[i], sqr1[(i + 1) % n]);
    s1.push_back(aux);
    aux = segment(sqr2[i], sqr2[(i + 1) % n]);
    s2.push_back(aux);
  }
  bool flag = false;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (s1[i].intersect(s2[j])) flag = true;
  if (inside(sqr1, sqr2) || inside(sqr2, sqr1)) flag = true;
  if (flag)
    puts("YES");
  else
    puts("NO");
}
