#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  bool operator==(const point &a) const {
    if (a.x == x && a.y == y) return true;
    return false;
  }
};
int orientation(point p1, point p2, point p3) {
  int m1, m2;
  m1 = (p2.y - p1.y) * (p3.x - p2.x), m2 = (p3.y - p2.y) * (p2.x - p1.x);
  if (m1 == m2)
    return 0;
  else if (m1 > m2)
    return 1;
  else if (m1 < m2)
    return 2;
}
int sqdist(point p1, point p2) {
  return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);
}
bool ifcrossed(point p1, point p2, point p3, point p4) {
  int o1 = orientation(p1, p2, p3), o2 = orientation(p1, p2, p4);
  if (o1 == 0 || o2 == 0) {
    if (sqdist(p1, p3) + sqdist(p3, p2) == sqdist(p1, p2) ||
        sqdist(p1, p4) + sqdist(p4, p2) == sqdist(p1, p2))
      return true;
  }
  if (o1 != o2 && orientation(p3, p4, p1) != orientation(p3, p4, p2))
    return true;
  return false;
}
bool check(point sq1[], point sq2[]) {
  int cnt = 0;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      int a = i, b = (i + 1) % 4, c = j, d = (j + 1) % 4;
      if (ifcrossed(sq1[a], sq1[b], sq2[c], sq2[d]))
        cnt++;
      else if (ifcrossed(sq1[a], sq1[b], sq2[c], sq2[d]))
        cnt++;
    }
  if (cnt == 0) {
    int ori2[4];
    for (int i = 0; i < 4; i++) {
      int ori[4];
      for (int j = 0; j < 4; j++) {
        int a = i, b = (i + 1) % 4;
        ori[j] = orientation(sq1[a], sq1[b], sq2[j]);
      }
      if ((ori[0] == 1 && ori[1] == 1 && ori[2] == 1 && ori[3] == 1) ||
          (ori[0] == 2 && ori[1] == 2 && ori[2] == 2 && ori[3] == 2)) {
      } else
        break;
      ori2[i] = ori[0];
    }
    if ((ori2[0] == 1 && ori2[1] == 1 && ori2[2] == 1 && ori2[3] == 1) ||
        (ori2[0] == 2 && ori2[1] == 2 && ori2[2] == 2 && ori2[3] == 2))
      cnt++;
  }
  if (cnt > 0) return true;
  return false;
}
int main() {
  int cnt = 0;
  point s1[4], s2[4];
  for (int i = 0; i < 4; i++) cin >> s1[i].x >> s1[i].y;
  for (int i = 0; i < 4; i++) cin >> s2[i].x >> s2[i].y;
  if (check(s1, s2) || check(s2, s1))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
