#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} A[40005], B[40005], CA[40005], CB[40005], S[40005];
int tot;
node operator+(node a, node b) { return node{a.x + b.x, a.y + b.y}; }
node operator-(node a, node b) { return node{a.x - b.x, a.y - b.y}; }
int operator*(node a, node b) { return a.x * b.y - a.y * b.x; }
bool operator<(node a, node b) {
  if (a.x == b.x) return a.y > b.y;
  return a.x > b.x;
}
void convex_hull(node p[], node c[], int n, int &tp) {
  sort(p + 1, p + n + 1);
  tp = 0;
  for (int i = 1; i <= n; i++) {
    while (tp > 1 && (c[tp] - p[i]) * (c[tp - 1] - p[i]) <= 0) tp--;
    c[++tp] = p[i];
  }
  int k = tp--;
  for (int i = n; i >= 1; i--) {
    while (tp > k && (c[tp] - p[i]) * (c[tp - 1] - p[i]) <= 0) tp--;
    c[++tp] = p[i];
  }
  tp--;
}
void getedge(node a[], int l, int r) {
  S[++tot] = node{l, r};
  if (l + 1 == r) return;
  int i = l, j = r;
  int dx = a[i].y - a[j].y;
  int dy = a[j].x - a[i].x;
  double minR = -1e100, maxR = 1e100;
  int mid = -1;
  for (int k = i + 1; k < j; ++k) {
    int ka = a[k].x - a[i].x;
    int kb = a[k].y - a[i].y;
    auto r = (double)((a[k].x - a[j].x) * ka + (a[k].y - a[j].y) * kb) /
             (dx * ka + dy * kb);
    if (r > minR) {
      mid = k;
      minR = r;
    }
  }
  getedge(a, l, mid);
  getedge(a, mid, r);
}
bool solve(node a[], node b[], int na, int nb) {
  tot = 0;
  getedge(a, 1, na);
  for (int p = 1; p <= tot; p++) {
    int i = S[p].x, j = S[p].y;
    int dx = a[i].y - a[j].y;
    int dy = a[j].x - a[i].x;
    double minR = -1e100, maxR = 1e100;
    int mid = -1;
    for (int k = i + 1; k < j; ++k) {
      int ka = a[k].x - a[i].x;
      int kb = a[k].y - a[i].y;
      auto r = (double)((a[k].x - a[j].x) * ka + (a[k].y - a[j].y) * kb) /
               (dx * ka + dy * kb);
      if (r > minR) {
        mid = k;
        minR = r;
      }
    }
    for (int k = j;;) {
      if (++k == na + 1) k = 1;
      if (k == i) break;
      int ka = a[k].x - a[i].x;
      int kb = a[k].y - a[i].y;
      auto r = (double)((a[k].x - a[j].x) * ka + (a[k].y - a[j].y) * kb) /
               (dx * ka + dy * kb);
      maxR = min(maxR, r);
    }
    bool yes = true;
    for (int k = 1; k <= nb; ++k) {
      int ka = b[k].x - a[i].x;
      int kb = b[k].y - a[i].y;
      int kc = (b[k].x - a[j].x) * ka + (b[k].y - a[j].y) * kb;
      int kd = dx * ka + dy * kb;
      auto r = (double)kc / kd;
      if (kd > 0) {
        maxR = min(maxR, r);
      } else if (kd < 0) {
        minR = max(minR, r);
      } else if (kc <= 0) {
        yes = false;
        break;
      }
      if (minR >= maxR) {
        yes = false;
        break;
      }
    }
    if (yes) return 1;
  }
  return 0;
}
int main() {
  int n, m, cn, cm;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &A[i].x, &A[i].y);
  for (int i = 1; i <= m; i++) scanf("%d%d", &B[i].x, &B[i].y);
  if (n == 1 || m == 1) return puts("YES"), 0;
  convex_hull(A, CA, n, cn);
  convex_hull(B, CB, m, cm);
  if (solve(CA, B, cn, m) || solve(CB, A, cm, n))
    puts("YES");
  else
    puts("NO");
}
