#include <bits/stdc++.h>
using namespace std;
int ur(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  return ((c.first - a.first) * (b.second - a.second) -
          (c.second - a.second) * (b.first - a.first));
}
bool intersection(pair<int, int> a, pair<int, int> b, pair<int, int> c,
                  pair<int, int> d) {
  if (ur(a, b, c) * ur(a, b, d) <= 0 && ur(c, d, a) * ur(c, d, b) <= 0) {
    return true;
  } else {
    return false;
  }
}
bool odnaStorona(pair<int, int> a, pair<int, int> b, pair<int, int> c,
                 pair<int, int> d) {
  if (ur(a, b, c) * ur(a, b, d) >= 0) {
    return true;
  } else {
    return false;
  }
}
bool inTr(pair<int, int> a, pair<int, int> b, pair<int, int> c,
          pair<int, int> d) {
  int x = ur(a, b, d);
  int y = ur(b, c, d);
  int z = ur(c, a, d);
  if (x * y >= 0 && x * z >= 0 && y * z >= 0) {
    return true;
  } else {
    return false;
  }
}
int main() {
  vector<pair<int, int>> a(4), b(4);
  for (int i = 0; i < 4; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  for (int i = 0; i < 4; ++i) {
    cin >> b[i].first >> b[i].second;
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (intersection(a[i % 4], a[(i + 1) % 4], b[j % 4], b[(j + 1) % 4])) {
        cout << "YES";
        return 0;
      }
    }
  }
  bool kvadratVnutri = true, rombVnutri = true;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (!odnaStorona(a[i % 4], a[(i + 1) % 4], b[j % 4], b[(j + 1) % 4])) {
        rombVnutri = false;
      }
    }
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (!odnaStorona(b[i % 4], b[(i + 1) % 4], a[j % 4], a[(j + 1) % 4])) {
        kvadratVnutri = false;
      }
    }
  }
  if (rombVnutri) {
    if (inTr(a[0], a[1], a[2], b[0]) || inTr(a[2], a[3], a[0], b[0])) {
      cout << "YES";
      return 0;
    }
  }
  if (kvadratVnutri) {
    if (inTr(b[0], b[1], b[2], a[0]) || inTr(b[2], b[3], b[0], a[0])) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
