#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 40005;
int n, m, tp, cc, px[N], py[N];
struct P {
  int x, y;
} a[N], b[N], c[N];
inline P operator+(const P& a, const P& b) { return (P){a.x + b.x, a.y + b.y}; }
inline P operator-(const P& a, const P& b) { return (P){a.x - b.x, a.y - b.y}; }
inline int operator*(const P& a, const P& b) { return a.x * b.y - a.y * b.x; }
inline int operator^(const P& a, const P& b) { return a.x * b.x + a.y * b.y; }
inline bool operator<(const P& a, const P& b) {
  return a.x == b.x ? a.y < b.y : a.x < b.x;
}
inline void GG() {
  puts("YES");
  exit(0);
}
inline void hull(int n, P* a, P* b) {
  sort(a + 1, a + n + 1);
  tp = 0;
  for (int i = 1; i <= n; b[++tp] = a[i++])
    while (tp >= 2 && (a[i] - b[tp - 1]) * (b[tp] - b[tp - 1]) <= 0) tp--;
  int ps = tp--;
  for (int i = n; i; b[++tp] = a[i--])
    while (tp > ps && (a[i] - b[tp - 1]) * (b[tp] - b[tp - 1]) <= 0) tp--;
  tp--;
}
void dv(int l, int r) {
  px[++cc] = l;
  py[cc] = r;
  if (l + 1 >= r) return;
  int p = -1;
  double v = -1e18;
  for (int i = l + 1; i <= r - 1; i++) {
    int v1 = (c[i] - c[l]) ^ (c[i] - c[r]), v2 = (c[l] - c[i]) * (c[l] - c[r]);
    double w = -1.0 * v1 / v2;
    if (w > v) v = w, p = i;
  }
  dv(l, p);
  dv(p, r);
}
inline void chk(int l, int r, int n, int m, P* b) {
  double vl = -1e18, vr = 1e18;
  for (int i = 1; i <= n && vl < vr; i++) {
    if (i == l || i == r) continue;
    int v1 = (c[i] - c[l]) ^ (c[i] - c[r]), v2 = (c[l] - c[i]) * (c[l] - c[r]);
    if (!v2) continue;
    double w = 1.0 * v1 / v2;
    if (v2 < 0)
      vr = min(vr, w);
    else
      vl = max(vl, w);
  }
  for (int i = 1; i <= m && vl < vr; i++) {
    int v1 = (b[i] - c[l]) ^ (b[i] - c[r]), v2 = (c[l] - b[i]) * (c[l] - c[r]);
    if (!v2) {
      if (v1 > 0) continue;
      vl = 1e19;
      break;
    }
    double w = 1.0 * v1 / v2;
    if (v2 > 0)
      vr = min(vr, w);
    else
      vl = max(vl, w);
  }
  if (vl < vr) GG();
}
inline void sol(int n, P* a, int m, P* b) {
  cc = 0;
  hull(n, a, c);
  dv(1, tp);
  for (int i = 1; i <= cc; i++) chk(px[i], py[i], tp, m, b);
}
int main() {
  scanf("%d%d", &n, &m);
  if (n == 1 || m == 1) GG();
  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);
  sol(n, a, m, b);
  sol(m, b, n, a);
  puts("NO");
  return 0;
}
