#include <bits/stdc++.h>
using namespace std;
struct IPoint {
  long long int x;
  long long int y;
  IPoint(long long int x_ = 0, long long int y_ = 0) : x(x_), y(y_) {}
  IPoint rotate(int r = 1) const {
    long long int rd = r % 4;
    long long int rr = r >= 0 ? rd : rd == 0 ? 0 : rd + 4;
    if (rr == 0)
      return IPoint(x, y);
    else if (rr == 1)
      return IPoint(-y, x);
    else if (rr == 2)
      return IPoint(-x, -y);
    else if (rr == 3)
      return IPoint(y, -x);
    assert(0);
  }
  IPoint mirror_x() const { return IPoint(x, -y); }
  IPoint mirror_y() const { return IPoint(-x, y); }
  bool parallel(const IPoint o) const { return x * o.y == y * o.x; }
  IPoint& operator+=(const IPoint& o) {
    x += o.x;
    y += o.y;
    return *this;
  }
  IPoint& operator-=(const IPoint& o) {
    x -= o.x;
    y -= o.y;
    return *this;
  }
  IPoint& operator*=(long long int k) {
    x *= k;
    y *= k;
    return *this;
  }
  bool operator==(const IPoint& o) const { return x == o.x && y == o.y; }
  IPoint operator+(const IPoint& o) const { return IPoint(x, y) += o; }
  IPoint operator-(const IPoint& o) const { return IPoint(x, y) -= o; }
  IPoint operator*(long long int k) const { return IPoint(x, y) *= k; }
  IPoint operator-() const { return IPoint(-x, -y); }
  bool operator<(const IPoint& o) const {
    if (x != o.x)
      return x < o.x;
    else
      return y < o.y;
  }
};
IPoint operator*(long long int k, const IPoint& p) { return p * k; }
istream& operator>>(istream& is, IPoint& p) {
  long long int x_, y_;
  is >> x_ >> y_;
  p.x = x_;
  p.y = y_;
  return is;
}
ostream& operator<<(ostream& os, const IPoint& p) {
  os << "(" << p.x << ", " << p.y << ")";
  return os;
}
namespace std {
template <>
struct hash<IPoint> {
  std::size_t operator()(const IPoint& p) const { return p.x * 37 + p.y * 41; }
};
}  // namespace std
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T1, typename T2, typename T3>
ostream& operator<<(ostream& os, const tuple<T1, T2, T3>& t) {
  os << "(" << get<0>(t) << ", " << get<1>(t) << ", " << get<2>(t) << ")";
  return os;
}
template <typename T1, typename T2, typename T3, typename T4>
ostream& operator<<(ostream& os, const tuple<T1, T2, T3, T4>& t) {
  os << "(" << get<0>(t) << ", " << get<1>(t) << ", " << get<2>(t) << ", "
     << get<3>(t) << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << '[';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << ']';
  return os;
}
template <typename T, typename C>
ostream& operator<<(ostream& os, const set<T, C>& v) {
  os << '{';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << '}';
  return os;
}
template <typename T, typename C>
ostream& operator<<(ostream& os, const unordered_set<T, C>& v) {
  os << '{';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << '}';
  return os;
}
template <typename T, typename C>
ostream& operator<<(ostream& os, const multiset<T, C>& v) {
  os << '{';
  for (auto it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ", ";
    os << *it;
  }
  os << '}';
  return os;
}
template <typename T1, typename T2, typename C>
ostream& operator<<(ostream& os, const map<T1, T2, C>& mp) {
  os << '[';
  for (auto it = mp.begin(); it != mp.end(); it++) {
    if (it != mp.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  os << ']';
  return os;
}
template <typename T1, typename T2, typename C>
ostream& operator<<(ostream& os, const unordered_map<T1, T2, C>& mp) {
  os << '[';
  for (auto it = mp.begin(); it != mp.end(); it++) {
    if (it != mp.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  os << ']';
  return os;
}
template <typename T, typename T2>
ostream& operator<<(ostream& os, const queue<T, T2>& orig) {
  queue<T, T2> que(orig);
  bool first = true;
  os << '[';
  while (!que.empty()) {
    T x = que.front();
    que.pop();
    if (!first) os << ", ";
    os << x;
    first = false;
  }
  return os << ']';
}
template <typename T, typename T2>
ostream& operator<<(ostream& os, const deque<T, T2>& orig) {
  deque<T, T2> que(orig);
  bool first = true;
  os << '[';
  while (!que.empty()) {
    T x = que.front();
    que.pop_front();
    if (!first) os << ", ";
    os << x;
    first = false;
  }
  return os << ']';
}
template <typename T, typename T2, typename T3>
ostream& operator<<(ostream& os, const priority_queue<T, T2, T3>& orig) {
  priority_queue<T, T2, T3> pq(orig);
  bool first = true;
  os << '[';
  while (!pq.empty()) {
    T x = pq.top();
    pq.pop();
    if (!first) os << ", ";
    os << x;
    first = false;
  }
  return os << ']';
}
template <typename T>
ostream& operator<<(ostream& os, const stack<T>& st) {
  stack<T> tmp(st);
  os << '[';
  bool first = true;
  while (!tmp.empty()) {
    T& t = tmp.top();
    if (first)
      first = false;
    else
      os << ", ";
    os << t;
    tmp.pop();
  }
  os << ']';
  return os;
}
ostream& operator<<(ostream& os, int8_t x) {
  os << (int32_t)x;
  return os;
}
template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}
template <class Head>
void dbgLog(bool with_nl, Head&& head) {
  cerr << head;
  if (with_nl) cerr << endl;
}
template <class Head, class... Tail>
void dbgLog(bool with_nl, Head&& head, Tail&&... tail) {
  cerr << head << " ";
  dbgLog(with_nl, forward<Tail>(tail)...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);
  vector<IPoint> P(4), Q(4);
  for (long long int i = 0; i < 4; i++) {
    IPoint p;
    cin >> p;
    P[i] = 4 * p;
  }
  for (long long int i = 0; i < 4; i++) {
    IPoint q;
    cin >> q;
    Q[i] = 4 * q;
  }
  auto f = [&](const vector<IPoint>& X, IPoint V) -> bool {
    long long int x0 = X[0].x, x1 = X[0].x;
    long long int y0 = X[0].y, y1 = X[0].y;
    for (long long int i = 0; i < 4; i++) {
      x0 = min(x0, X[i].x);
      x1 = max(x1, X[i].x);
      y0 = min(y0, X[i].y);
      y1 = max(y1, X[i].y);
    }
    return x0 <= V.x && V.x <= x1 && y0 <= V.y && V.y <= y1;
  };
  for (long long int i = 0; i < 4; i++) {
    if (f(P, Q[i])) {
      cout << "YES\n";
      return 0;
    }
  }
  IPoint C(0, 0);
  for (long long int i = 0; i < 4; i++) C = C + Q[i];
  C.x = C.x / 4;
  C.y = C.y / 4;
  if (f(P, C)) {
    cout << "YES\n";
    return 0;
  }
  vector<IPoint> P2(4), Q2(4);
  for (long long int i = 0; i < 4; i++) {
    P2[i].x = P[i].x + P[i].y;
    P2[i].y = P[i].x - P[i].y;
    Q2[i].x = Q[i].x + Q[i].y;
    Q2[i].y = Q[i].x - Q[i].y;
    ;
  }
  for (long long int i = 0; i < 4; i++) {
    if (f(Q2, P2[i])) {
      cout << "YES\n";
      return 0;
    }
  }
  IPoint C2(0, 0);
  for (long long int i = 0; i < 4; i++) C2 = C2 + P2[i];
  C2.x = C2.x / 4;
  C2.y = C2.y / 4;
  if (f(Q2, C2)) {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
