#include <bits/stdc++.h>
using namespace std;
double prodvec(complex<double> p1, complex<double> p2) {
  return imag(conj(p1) * p2);
}
vector<complex<double> > read() {
  vector<complex<double> > s(4);
  for (int i = 0; i < 4; i++) {
    int x, y;
    cin >> x >> y;
    s[i] = complex<double>(x, y);
  }
  return s;
}
double area(vector<complex<double> > s) {
  double a = 0;
  for (int i = 1; i < 3; i++) a += prodvec(s[i] - s[0], s[i + 1] - s[0]);
  return a;
}
vector<complex<double> > normalize(vector<complex<double> > s) {
  if (area(s) > 0) return s;
  reverse(s.begin(), s.end());
  return s;
}
complex<double> medium(vector<complex<double> > s) {
  complex<double> p(0, 0);
  for (int i = 0; i < 4; i++) p = p + s[i];
  return 0.25 * p;
}
void morir() {
  cout << "YES" << endl;
  exit(0);
}
void inside(complex<double> p, vector<complex<double> > s) {
  for (int i = 0; i < 4; i++) {
    complex<double> p1 = s[i];
    complex<double> p2 = s[(i + 1) % 4];
    if (prodvec(p1 - p, p2 - p) < 0) return;
  }
  morir();
}
int main() {
  vector<complex<double> > s1 = normalize(read());
  vector<complex<double> > s2 = normalize(read());
  for (int i = 0; i < 4; i++) {
    inside(s1[i], s2);
    inside(s2[i], s1);
  }
  inside(medium(s1), s2);
  inside(medium(s2), s1);
  cout << "NO" << endl;
}
