#include <bits/stdc++.h>
using namespace std;
namespace red {
inline int read() {
  int x = 0;
  char ch, f = 1;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') f = 0, ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return f ? x : -x;
}
const int N = 1e4 + 10;
const long double eps = 1e-12;
int n, m, s1, s2;
inline int check(long double x) { return x > -eps ? (x > eps) : -1; }
struct node {
  long double x, y;
  node(long double x = 0, long double y = 0) : x(x), y(y) {}
  friend node operator+(node a, node b) { return node(a.x + b.x, a.y + b.y); }
  friend node operator-(node a, node b) { return node(a.x - b.x, a.y - b.y); }
  friend node operator*(node a, long double b) {
    return node(a.x * b, a.y + b);
  }
  friend bool operator<(node a, node b) {
    return check(a.x - b.x) == 0 ? a.y < a.y : a.x < b.x;
  }
} a[N], b[N], tp[N], p[N];
long double ag[N];
int rk[N];
inline void fuck() {
  puts("YES");
  exit(0);
}
inline long double dot(node a, node b) { return a.x * b.x + a.y * b.y; }
inline long double cross(node a, node b) { return a.x * b.y - a.y * b.x; }
inline bool cmp(int x, int y) {
  return check(ag[x] - ag[y]) == 0 ? tp[x] < tp[y] : ag[x] < ag[y];
}
inline void get_convex_hull(node *p, int n, node *q, int &m) {
  for (int i = 1; i < n; ++i)
    if (check(p[i].x - p[0].x) < 0 ||
        check(p[i].x - p[0].x) == 0 && check(p[i].y - p[0].y) < 0)
      swap(p[i], p[0]);
  for (int i = 1; i < n; ++i)
    ag[i] = atan2(p[i].y - p[0].y, p[i].x - p[0].x), rk[i] = i, tp[i] = p[i];
  sort(rk + 1, rk + n, cmp);
  q[m = 0] = p[0];
  for (int i = 1; i < n; ++i) {
    node cur = p[rk[i]];
    while (m && check(cross(q[m] - q[m - 1], cur - q[m - 1])) <= 0) m--;
    q[++m] = cur;
  }
  ++m;
}
inline void update(node p, node q, node *a, int n, node *b, int m) {
  long double l = -1e100, r = 1e100;
  for (int i = 0; i < n; ++i)
    if (check(cross(p - a[i], q - a[i]))) {
      if (check(cross(a[i] - p, q - p)) < 0)
        l = max(l, dot(p - a[i], q - a[i]) / cross(p - a[i], q - a[i]));
      else
        r = min(r, dot(p - a[i], q - a[i]) / cross(p - a[i], q - a[i]));
    }
  for (int i = 0; i < m; ++i) {
    if (check(cross(p - b[i], q - b[i])) == 0) {
      if (check(min(p.x, q.x) - b[i].x) > 0 ||
          check(b[i].x - max(p.x, q.x)) > 0)
        continue;
      if (check(min(p.y, q.y) - b[i].y) > 0 ||
          check(b[i].y - max(p.y, q.y)) > 0)
        continue;
      return;
    }
    if (check(cross(b[i] - p, q - p)) < 0)
      r = min(r, dot(p - b[i], q - b[i]) / cross(p - b[i], q - b[i]));
    else
      l = max(l, dot(p - b[i], q - b[i]) / cross(p - b[i], q - b[i]));
    if (l >= r - eps) return;
  }
  fuck();
}
inline void sol(int l, int r) {
  if ((l + 1) % n == r) {
    update(p[l], p[r], p, n, b, s2);
    return;
  }
  int x;
  long double ret = 1e100;
  for (int i = (l + 1) % n; i != r; i = (i + 1) % n) {
    long double tmp =
        dot(p[i] - p[l], p[i] - p[r]) / cross(p[i] - p[l], p[i] - p[r]);
    if (tmp < ret) ret = tmp, x = i;
  }
  update(p[x], p[l], p, n, b, s2);
  update(p[x], p[r], p, n, b, s2);
  sol(l, x);
  sol(x, r);
}
inline void work() {
  get_convex_hull(a, s1, p, n);
  update(p[0], p[n - 1], p, n, b, s2);
  sol(0, n - 1);
}
inline void main() {
  s1 = read(), s2 = read();
  for (int i = 0; i < s1; ++i) cin >> a[i].x >> a[i].y;
  for (int i = 0; i < s2; ++i) cin >> b[i].x >> b[i].y;
  work();
  for (int i = 0; i < max(s1, s2); ++i) swap(a[i], b[i]);
  swap(s1, s2);
  work();
  puts("NO");
}
}  // namespace red
signed main() {
  red::main();
  return 0;
}
