#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <set>
#include <bitset>
#include <map>

using namespace std;

int main()
{
  double x, y;
  complex<double> coor[4], _coor[4];
  while (scanf("%lf %lf ", &x, &y) == 2) {
    coor[0] = complex<double>(x, y);
    scanf("%lf %lf ", &x, &y);
    coor[2] = complex<double>(x, y);
    scanf("%lf %lf ", &x, &y);
    _coor[0] = complex<double>(x, y);
    scanf("%lf %lf ", &x, &y);
    _coor[2] = complex<double>(x, y);
    coor[1] = complex<double>(coor[0].real(), coor[2].imag());
    coor[3] = complex<double>(coor[2].real(), coor[0].imag());
    _coor[1] = complex<double>(_coor[0].real(), _coor[2].imag());
    _coor[3] = complex<double>(_coor[2].real(), _coor[0].imag());
    complex<double> g(0, 0);
    for (int i = 0; i < 4; i++) {
      g += _coor[i];
    }
    g /= 4;
    int c = 0;
  first:;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
	if (_coor[j].real() == _coor[(j + 1) % 4].real())  {
	  if ((coor[i].real() - _coor[j].real()) * (g.real() - _coor[j].real()) < 0) {
	    goto next;
	  }
	} else {
	  if ((coor[i].imag() - _coor[j].imag()) * (g.imag() - _coor[j].imag()) < 0) {
	    goto next;
	  }
	}
      }
      cout << "YES" << endl;
      goto end;
    next:;
    }
    if (c++ == 0) {
      g = complex<double>(0, 0);
      for (int i = 0; i < 4; i++) {
	g += coor[i];
      }
      for (int i = 0; i < 4; i++) {
	swap(coor[i], _coor[i]);
      }
    } else {
      cout << "NO" << endl;
    }
  end:;
  }
}