#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 9;
struct Point {
  double x, y;
  Point operator-(const Point& b) const { return (Point){x - b.x, y - b.y}; }
  Point operator+(const Point& b) const { return (Point){x + b.x, y + b.y}; }
  Point operator*(const double& b) const { return (Point){x * b, y * b}; }
  bool operator<(const Point& b) const {
    return x < b.x || (x == b.x && y < b.y);
  }
} pa[N], pb[N], ha[N], hb[N];
int na, nb, nha, nhb;
vector<pair<int, int> > edge;
int sgn(double x) {
  if (fabs(x) < 1e-10) return 0;
  if (x < 0) return -1;
  return 1;
}
double cross(Point a, Point b) { return a.x * b.y - b.x * a.y; }
double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double len2(Point a) { return a.x * a.x + a.y * a.y; }
double len(Point a) { return sqrt(len2(a)); }
Point core(Point a, Point b, Point c) {
  Point A = (Point){b.x - a.x, c.x - a.x} * 2,
        B = (Point){b.y - a.y, c.y - a.y} * 2;
  Point C = (Point){len2(b) - len2(a), len2(c) - len2(a)};
  return (Point){cross(B, C) / cross(B, A), cross(A, C) / cross(A, B)};
}
void Andrew(Point p[], int n, Point ch[], int& m) {
  sort(p, p + n);
  m = 0;
  for (int i = 0; i < n; ++i) {
    while (m > 1 && cross(p[i] - ch[m - 2], ch[m - 1] - ch[m - 2]) >= 0) --m;
    ch[m++] = p[i];
  }
  int k = m;
  for (int i = n - 2; i >= 0; --i) {
    while (m > k && cross(p[i] - ch[m - 2], ch[m - 1] - ch[m - 2]) >= 0) --m;
    ch[m++] = p[i];
  }
  if (n > 1) --m;
}
bool check(Point A[], int na, Point B[], int nb, int l, int r) {
  if (na == 1) {
    return 1;
  }
  Point o = (A[l] + A[r]) * 0.5;
  double mi = -1e16, mx = 1e16;
  int mid = -1;
  bool res = 1;
  for (int i = l + 1; i < r; ++i) {
    Point c = core(A[l], A[r], A[i]);
    double d = len(c - o);
    if (sgn(cross(c - A[l], A[r] - A[l])) < 0) d = -d;
    if (mi < d) {
      mi = d;
      mid = i;
    }
    if (mx <= mi) res = 0;
  }
  for (int i = (r + 1) % na; i != l; i = (i + 1) % na) {
    Point c = core(A[l], A[r], A[i]);
    double d = len(c - o);
    if (sgn(cross(c - A[l], A[r] - A[l])) < 0) d = -d;
    if (mx > d) mx = d;
    if (mx <= mi) res = 0;
  }
  if (mx < mi + 1e-10) res = 0;
  for (int i = 0; i < nb && res; ++i) {
    int fx = sgn(cross(B[i] - A[l], A[r] - A[l]));
    if (fx == 0) {
      if (sgn(dot(A[r] - B[i], A[l] - B[i])) < 0) res = 0;
    } else {
      Point c = core(A[l], A[r], B[i]);
      double d = len(c - o);
      if (sgn(cross(c - A[l], A[r] - A[l])) < 0) d = -d;
      if (fx > 0) {
        if (mx > d) mx = d;
      } else {
        if (mi < d) mi = d;
      }
    }
    if (mx <= mi) res = 0;
  }
  return res || (mid != -1 &&
                 (check(A, na, B, nb, l, mid) || check(A, na, B, nb, mid, r)));
}
int main() {
  scanf("%d %d", &na, &nb);
  for (int i = 0; i < na; ++i) scanf("%lf %lf", &pa[i].x, &pa[i].y);
  for (int i = 0; i < nb; ++i) scanf("%lf %lf", &pb[i].x, &pb[i].y);
  Andrew(pa, na, ha, nha);
  Andrew(pb, nb, hb, nhb);
  if (check(ha, nha, pb, nb, 0, nha - 1) || check(hb, nhb, pa, na, 0, nhb - 1))
    puts("YES");
  else
    puts("NO");
  return 0;
}
