#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, x, y, tmp1x, tmp1y, tmp2x, tmp2y;
  vector<pair<long long, long long> > one, two;
  vector<long long> one_y_same, one_x_same, two_y_same, two_x_same;
  for (i = 0; i < 4; i++) {
    cin >> x >> y;
    one.push_back({x, y});
  }
  for (i = 0; i < 4; i++) {
    cin >> x >> y;
    two.push_back({x, y});
  }
  vector<long long> posslope, negslope;
  if ((one[2].second - one[0].second) * (one[2].first - one[0].first) >= 0) {
    posslope.push_back(0);
    posslope.push_back(2);
    negslope.push_back(1);
    negslope.push_back(3);
  } else {
    posslope.push_back(1);
    posslope.push_back(3);
    negslope.push_back(0);
    negslope.push_back(2);
  }
  if (one[0].first == one[1].first) {
    one_x_same.push_back(one[0].second);
    one_x_same.push_back(one[1].second);
    one_y_same.push_back(one[1].first);
    one_y_same.push_back(one[2].first);
  } else {
    one_x_same.push_back(one[1].second);
    one_x_same.push_back(one[2].second);
    one_y_same.push_back(one[0].first);
    one_y_same.push_back(one[1].first);
  }
  if (two[0].first == two[2].first) {
    two_x_same.push_back(two[0].second);
    two_x_same.push_back(two[2].second);
    two_y_same.push_back(two[1].first);
    two_y_same.push_back(two[3].first);
  } else {
    two_x_same.push_back(two[1].second);
    two_x_same.push_back(two[3].second);
    two_y_same.push_back(two[0].first);
    two_y_same.push_back(two[2].first);
  }
  long long intersections = 0;
  long long chk[2], oth[2];
  chk[0] = one_x_same[0];
  chk[1] = one_x_same[1];
  oth[0] = two_x_same[0];
  oth[1] = two_x_same[1];
  sort(chk, chk + 2);
  sort(oth, oth + 2);
  if (oth[0] > chk[1] || chk[0] > oth[1]) {
    cout << "NO";
    return 0;
  } else {
    intersections++;
  }
  chk[0] = one_y_same[0];
  chk[1] = one_y_same[1];
  oth[0] = two_y_same[0];
  oth[1] = two_y_same[1];
  sort(chk, chk + 2);
  sort(oth, oth + 2);
  if (oth[0] > chk[1] || chk[0] > oth[1]) {
    cout << "NO";
    return 0;
  } else {
    intersections++;
  }
  chk[0] = two[0].second;
  chk[1] = two[1].second;
  long long slope;
  if ((two[1].second - two[0].second) * (two[1].first - two[0].first) >= 0) {
    slope = 1;
  } else {
    slope = -1;
  }
  if (slope == 1) {
    tmp1x = one[posslope[0]].first;
    tmp1y = one[posslope[0]].second;
    tmp2x = one[posslope[1]].first;
    tmp2y = one[posslope[1]].second;
  } else {
    tmp1x = one[negslope[0]].first;
    tmp1y = one[negslope[0]].second;
    tmp2x = one[negslope[1]].first;
    tmp2y = one[negslope[1]].second;
  }
  oth[0] = two[0].second - (slope * two[0].first) + tmp1y + (slope * tmp1x);
  oth[1] = two[0].second - (slope * two[0].first) + tmp2y + (slope * tmp2x);
  sort(chk, chk + 2);
  sort(oth, oth + 2);
  if (oth[0] > chk[1] * 2 || chk[0] * 2 > oth[1]) {
    cout << "NO";
    return 0;
  } else {
    intersections++;
  }
  chk[0] = two[2].second;
  chk[1] = two[1].second;
  if ((two[1].second - two[2].second) * (two[1].first - two[2].first) >= 0) {
    slope = 1;
  } else {
    slope = -1;
  }
  if (slope == 1) {
    tmp1x = one[posslope[0]].first;
    tmp1y = one[posslope[0]].second;
    tmp2x = one[posslope[1]].first;
    tmp2y = one[posslope[1]].second;
  } else {
    tmp1x = one[negslope[0]].first;
    tmp1y = one[negslope[0]].second;
    tmp2x = one[negslope[1]].first;
    tmp2y = one[negslope[1]].second;
  }
  oth[0] = two[1].second - (slope * two[1].first) + tmp1y + (slope * tmp1x);
  oth[1] = two[1].second - (slope * two[1].first) + tmp2y + (slope * tmp2x);
  sort(chk, chk + 2);
  sort(oth, oth + 2);
  if (oth[0] > 2 * chk[1] || chk[0] * 2 > oth[1]) {
    cout << "NO";
    return 0;
  } else {
    intersections++;
  }
  cout << "YES";
  return 0;
}
