#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1.0), eps = 1e-7;
template <class T>
struct point {
  T x, y;
  point(T x = (T)0, T y = (T)0) : x(x), y(y) {}
  bool operator<(const point &o) const { return x != o.x ? x < o.x : y < o.y; }
  bool operator==(const point &o) const {
    return abs(o.x - x) <= (T)eps and abs(o.y - y) <= (T)eps;
  }
  bool operator<=(const point &o) const { return *this == o or *this < o; }
  point operator+(const point &p) const { return point(x + p.x, y + p.y); }
  point &operator+=(const point &p) {
    x += p.x;
    y += p.y;
    return *this;
  }
  point operator-(const point &p) const { return point(x - p.x, y - p.y); }
  point &operator-=(const point &p) const {
    x -= p.x;
    y -= p.y;
    return *this;
  }
  point operator*(T a) const { return point(x * a, y * a); }
  point &operator*=(T a) {
    x *= a;
    y *= a;
    return *this;
  }
  point operator/(T a) const { return point(x / a, y / a); }
  point &operator/=(T a) {
    x /= a;
    y /= a;
    return *this;
  }
  T operator*(const point &p) const { return x * p.x + y * p.y; }
  T operator^(const point &p) const { return x * p.y - y * p.x; }
  long double angle() const { return atan2(y, x); }
  long double dist(const point &p) const { return hypot(x - p.x, y - p.y); }
  long double norm() const { return hypot(x, y); }
  point &normalize() { return *this /= norm(); }
  T sqnorm() const { return x * x + y * y; }
  point &operator-() {
    x = -x;
    y = -y;
    return *this;
  }
};
point<long long> operator*(long long a, point<long long> &p) { return p * a; }
point<long double> operator*(long double a, point<long double> &p) {
  return p * a;
}
point<int> operator*(int a, point<int> &p) { return p * a; }
point<long double> polar(long double r, long double theta) {
  return point<long double>(r * cos(theta), r * sin(theta));
}
template <class T>
istream &operator>>(istream &in, point<T> &p) {
  return in >> p.x >> p.y;
}
template <class T>
ostream &operator<<(ostream &out, point<T> &p) {
  return out << p.x << ' ' << p.y;
}
template <class T>
int sgn(T x) {
  return x > (T)eps ? 1 : x < -(T)eps ? -1 : 0;
}
template <class T>
bool intersect(point<T> &a, point<T> &b, point<T> &c, point<T> &d) {
  return sgn((c - a) ^ (b - a)) * sgn((d - a) ^ (b - a)) <= 0 &&
         sgn((a - c) ^ (d - c)) * sgn((b - c) ^ (d - c)) <= 0;
}
template <class T>
bool inside(vector<point<T>> &P1, vector<point<T>> &P2) {
  for (int i = 0; i < P1.size(); i++) {
    point<T> A1 = P1[i];
    int ss;
    for (int j = 0; j < P2.size(); j++) {
      point<T> A2 = P2[j];
      point<T> A3 = P2[(j + 1) % 4];
      point<T> a = A1 - A2;
      point<T> b = A3 - A2;
      int s = sgn(a ^ b);
      if (j == 0)
        ss = s;
      else {
        if (s != ss) {
          return false;
        }
      }
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  vector<vector<point<int>>> square(2, vector<point<int>>(4));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> square[i][j];
    }
  }
  for (int i = 0; i < 4; i++) {
    point<int> A1 = square[0][i];
    point<int> A2 = square[0][(i + 1) % 4];
    for (int j = 0; j < 4; j++) {
      point<int> A3 = square[1][j];
      point<int> A4 = square[1][(j + 1) % 4];
      if (intersect(A1, A2, A3, A4)) {
        cout << "YES\n";
        return 0;
      }
    }
  }
  bool inside1 = inside(square[0], square[1]);
  bool inside2 = inside(square[1], square[0]);
  if (inside1 or inside2) {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
