#include <bits/stdc++.h>
using namespace std;
const int MAX = 2 * 1e5 + 1, MAXP = 4 * 1e4;
typedef struct point {
  int x;
  int y;
};
point p1, p2, p3, p4, lef, righ, top, down;
int najveci(int a, int b, int c, int d) {
  int ret = a;
  ret = max(ret, b);
  ret = max(ret, c);
  ret = max(ret, d);
  return ret;
}
int najmanji(int a, int b, int c, int d) {
  int ret = a;
  ret = min(ret, b);
  ret = min(ret, c);
  ret = min(ret, d);
  return ret;
}
int P(point A, point B, point C) {
  return abs(A.x * (B.y - C.y) + B.x * (C.y - A.y) + C.x * (A.y - B.y));
}
bool in1(point a) {
  return ((P(a, lef, top) + P(a, top, righ) + P(a, righ, down) +
           P(a, down, lef)) == ((top.y - down.y) * (righ.x - lef.x)));
}
bool in2(point a) {
  return ((P(a, p1, p2) + P(a, p2, p3) + P(a, p3, p4) + P(a, p4, p1)) ==
          (2 * (p2.x - p1.x) * (p4.y - p1.y)));
}
bool inbig() { return (in1(p1) || in1(p2) || in1(p3) || in1(p4)); }
bool insmall() { return (in2(lef) || in2(righ) || in2(top) || in2(down)); }
int main() {
  point t1, t2, t3, t4, h1, h2, h3, h4;
  scanf("%i%i%i%i%i%i%i%i", &t1.x, &t1.y, &t2.x, &t2.y, &t3.x, &t3.y, &t4.x,
        &t4.y);
  scanf("%i%i%i%i%i%i%i%i", &h1.x, &h1.y, &h2.x, &h2.y, &h3.x, &h3.y, &h4.x,
        &h4.y);
  int b = najmanji(t1.x, t2.x, t3.x, t4.x),
      c = najmanji(t1.y, t2.y, t3.y, t4.y), d = najveci(t1.x, t2.x, t3.x, t4.x),
      e = najveci(t1.y, t2.y, t3.y, t4.y);
  if (t1.x == b && t1.y == c) {
    p1.x = t1.x, p1.y = t1.y;
  }
  if (t2.x == b && t2.y == c) {
    p1.x = t2.x, p1.y = t2.y;
  }
  if (t3.x == b && t3.y == c) {
    p1.x = t3.x, p1.y = t3.y;
  }
  if (t4.x == b && t4.y == c) {
    p1.x = t4.x, p1.y = t4.y;
  }
  if (t1.x == d && t1.y == c) {
    p2.x = t1.x, p2.y = t1.y;
  }
  if (t2.x == d && t2.y == c) {
    p2.x = t2.x, p2.y = t2.y;
  }
  if (t3.x == d && t3.y == c) {
    p2.x = t3.x, p2.y = t3.y;
  }
  if (t4.x == d && t4.y == c) {
    p2.x = t4.x, p2.y = t4.y;
  }
  if (t1.x == d && t1.y == e) {
    p3.x = t1.x, p3.y = t1.y;
  }
  if (t2.x == d && t2.y == e) {
    p3.x = t2.x, p3.y = t2.y;
  }
  if (t3.x == d && t3.y == e) {
    p3.x = t3.x, p3.y = t3.y;
  }
  if (t4.x == d && t4.y == e) {
    p3.x = t4.x, p3.y = t4.y;
  }
  if (t1.x == b && t1.y == e) {
    p4.x = t1.x, p4.y = t1.y;
  }
  if (t2.x == b && t2.y == e) {
    p4.x = t2.x, p4.y = t2.y;
  }
  if (t3.x == b && t3.y == e) {
    p4.x = t3.x, p4.y = t3.y;
  }
  if (t4.x == b && t4.y == e) {
    p4.x = t4.x, p4.y = t4.y;
  }
  b = najmanji(h1.x, h2.x, h3.x, h4.x), c = najmanji(h1.y, h2.y, h3.y, h4.y),
  d = najveci(h1.x, h2.x, h3.x, h4.x), e = najveci(h1.y, h2.y, h3.y, h4.y);
  if (h1.x == b) {
    lef.x = h1.x, lef.y = h1.y;
  }
  if (h2.x == b) {
    lef.x = h2.x, lef.y = h2.y;
  }
  if (h3.x == b) {
    lef.x = h3.x, lef.y = h3.y;
  }
  if (h4.x == b) {
    lef.x = h4.x, lef.y = h4.y;
  }
  if (h1.x == d) {
    righ.x = h1.x, righ.y = h1.y;
  }
  if (h2.x == d) {
    righ.x = h2.x, righ.y = h2.y;
  }
  if (h3.x == d) {
    righ.x = h3.x, righ.y = h3.y;
  }
  if (h4.x == d) {
    righ.x = h4.x, righ.y = h4.y;
  }
  if (h1.y == e) {
    top.x = h1.x, top.y = h1.y;
  }
  if (h2.y == e) {
    top.x = h2.x, top.y = h2.y;
  }
  if (h3.y == e) {
    top.x = h3.x, top.y = h3.y;
  }
  if (h4.y == e) {
    top.x = h4.x, top.y = h4.y;
  }
  if (h1.y == c) {
    down.x = h1.x, down.y = h1.y;
  }
  if (h2.y == c) {
    down.x = h2.x, down.y = h2.y;
  }
  if (h3.y == c) {
    down.x = h3.x, down.y = h3.y;
  }
  if (h4.y == c) {
    down.x = h4.x, down.y = h4.y;
  }
  point s, t;
  s.x = (lef.x + righ.x) / 2, s.y = (lef.y + righ.y) / 2;
  t.x = (p1.x + p3.x) / 2, t.y = (p1.y + p3.y) / 2;
  if (inbig() || insmall() || inbig() || in1(t) || in2(s))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
