#include <bits/stdc++.h>
using namespace std;
template <class t>
inline void read(t &res) {
  char ch;
  bool fl = 0;
  res = 0;
  while (ch = getchar(), !isdigit(ch) && ch != '-')
    ;
  ch == '-' ? fl = 1 : res = ch ^ 48;
  while (ch = getchar(), isdigit(ch)) res = res * 10 + (ch ^ 48);
  fl ? res = ~res + 1 : 0;
}
const int e = 2e4 + 5;
const long double eps = 1e-14;
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
  inline int norm() { return x * x + y * y; }
} a[e], b[e], p[e], stk[e];
int n, m, cnt, top;
inline point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
inline point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
inline int dot(point a, point b) { return a.x * b.x + a.y * b.y; }
inline int operator*(point a, point b) { return a.x * b.y - a.y * b.x; }
inline bool cmp(const point &a, const point &b) {
  int d = (a - p[1]) * (b - p[1]);
  return d != 0 ? d > 0 : (a - p[1]).norm() < (b - p[1]).norm();
}
inline void get_convex() {
  int i;
  for (i = 1; i <= n; i++) p[i] = a[i];
  for (i = 2; i <= n; i++)
    if (p[i].x < p[1].x || (p[i].x == p[1].x && p[i].y < p[1].y))
      swap(p[1], p[i]);
  if (n >= 2) sort(p + 2, p + n + 1, cmp);
  stk[top = 1] = p[1];
  for (i = 2; i <= n; i++) {
    while (top >= 2 && (stk[top] - stk[top - 1]) * (p[i] - stk[top - 1]) <= 0)
      top--;
    stk[++top] = p[i];
  }
  for (i = 1; i <= top; i++) p[i] = stk[i];
  cnt = top;
}
inline bool check(point c, point d) {
  long double l = -1e100L, r = 1e100L;
  int i;
  for (i = 1; i <= n; i++) {
    point u = a[i];
    int cha = (c - u) * (d - u);
    if (cha == 0) continue;
    long double w = (long double)dot(c - u, d - u) / cha;
    if ((d - c) * (u - c) > 0)
      l = max(l, w);
    else
      r = min(r, w);
    if (r - l <= eps) return 0;
  }
  for (i = 1; i <= m; i++) {
    point u = b[i];
    int cha = (c - u) * (d - u);
    if (cha == 0) {
      if (min(c.x, d.x) <= u.x && u.x <= max(c.x, d.x) &&
          min(c.y, d.y) <= u.y && u.y <= max(c.y, d.y))
        return 0;
      continue;
    }
    long double w = (long double)dot(c - u, d - u) / cha;
    if ((d - c) * (u - c) < 0)
      l = max(l, w);
    else
      r = min(r, w);
    if (r - l <= eps) return 0;
  }
  return r - l > eps;
}
inline bool solve(int l, int r) {
  if (l + 1 == r) return 0;
  int i, x;
  long double mi = 1e100L;
  for (i = l + 1; i < r; i++) {
    point u = p[i];
    long double d =
        (long double)dot(u - p[l], u - p[r]) / ((u - p[l]) * (u - p[r]));
    if (d < mi) mi = d, x = i;
  }
  return check(p[l], p[x]) || check(p[x], p[r]) || solve(l, x) || solve(x, r);
}
inline bool pd() {
  get_convex();
  if (cnt == 1) {
    int i;
    for (i = 1; i <= m; i++)
      if (b[i].x == p[1].x && b[i].y == p[1].y) return 0;
    return 1;
  }
  return check(p[1], p[cnt]) || solve(1, cnt);
}
int main() {
  int i, x, y;
  read(n);
  read(m);
  for (i = 1; i <= n; i++) {
    read(x);
    read(y);
    a[i].x = x;
    a[i].y = y;
  }
  for (i = 1; i <= m; i++) {
    read(x);
    read(y);
    b[i].x = x;
    b[i].y = y;
  }
  if (pd()) {
    puts("YES");
    return 0;
  }
  swap(n, m);
  swap(a, b);
  puts(pd() ? "YES" : "NO");
  return 0;
}
