#include <bits/stdc++.h>
using namespace std;
struct points {
  float x, y;
};
float line(points p, points p1, points p2) {
  return (((p2.x - p1.x) * (p.y - p1.y)) - ((p2.y - p1.y) * (p.x - p1.x)));
}
int main() {
  points 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;
  int val[4];
  for (int i = 0; i < 4; ++i) {
    val[0] = 0;
    val[1] = 0;
    val[2] = 0;
    val[3] = 0;
    for (int j = 0; j < 4; ++j) {
      if (j < 2)
        val[j] = line(s1[i], s2[j], s2[(j + 1) % 4]);
      else
        val[j] = line(s1[i], s2[(j + 1) % 4], s2[j]);
    }
    if ((val[0] * val[2] <= 0.00) && (val[1] * val[3] <= 0.00)) {
      cout << "YES" << endl;
      return 0;
    }
  }
  val[0] = 0;
  val[1] = 0;
  val[2] = 0;
  val[3] = 0;
  points centre;
  centre.x = (s1[0].x + s1[2].x) / 2.00;
  centre.y = (s1[0].y + s1[2].y) / 2.00;
  for (int j = 0; j < 4; ++j) {
    if (j < 2)
      val[j] = line(centre, s2[j], s2[(j + 1) % 4]);
    else
      val[j] = line(centre, s2[(j + 1) % 4], s2[j]);
  }
  if ((val[0] * val[2] <= 0.00) && (val[1] * val[3] <= 0.00)) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < 4; ++i) {
    val[0] = 0;
    val[1] = 0;
    val[2] = 0;
    val[3] = 0;
    for (int j = 0; j < 4; ++j) {
      if (j < 2)
        val[j] = line(s2[i], s1[j], s1[(j + 1) % 4]);
      else
        val[j] = line(s2[i], s1[(j + 1) % 4], s1[j]);
    }
    if ((val[0] * val[2] <= 0.00) && (val[1] * val[3] <= 0.00)) {
      cout << "YES" << endl;
      return 0;
    }
  }
  val[0] = 0;
  val[1] = 0;
  val[2] = 0;
  val[3] = 0;
  centre.x = (s2[0].x + s2[2].x) / 2.00;
  centre.y = (s2[0].y + s2[2].y) / 2.00;
  for (int j = 0; j < 4; ++j) {
    if (j < 2)
      val[j] = line(centre, s1[j], s1[(j + 1) % 4]);
    else
      val[j] = line(centre, s1[(j + 1) % 4], s1[j]);
  }
  if ((val[0] * val[2] <= 0.00) && (val[1] * val[3] <= 0.00)) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
