#include <bits/stdc++.h>
using namespace std;
const int N = 10005;
const double eps = 1e-12, inf = 1e100;
int read() {
  int f = 1, g = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) g = g * 10 + ch - '0';
  return f * g;
}
int n, m, cnt;
struct vec {
  int x, y;
} a[N], b[N], c[N];
vec operator+(vec a, vec b) { return (vec){a.x + b.x, a.y + b.y}; }
vec operator-(vec a, vec b) { return (vec){a.x - b.x, a.y - b.y}; }
vec operator*(vec a, int k) { return (vec){a.x * k, a.y * k}; }
vec operator/(vec a, int k) { return (vec){a.x / k, a.y / k}; }
long long operator^(vec a, vec b) {
  return (long long)a.x * b.y - (long long)a.y * b.x;
}
long long operator&(vec a, vec b) {
  return (long long)a.x * b.x + (long long)a.y * b.y;
}
bool cmp(vec a, vec b) { return (a.x != b.x) ? (a.x < b.x) : (a.y < b.y); }
bool side(vec a, vec b, vec c) { return ((b - a) ^ (c - a)) >= 0; }
double val(vec a, vec b, vec c) {
  return 1.0 * ((a - c) & (b - c)) / ((a - c) ^ (b - c));
}
void check(int x, int y) {
  double l = -inf, r = inf;
  for (int i = 1; i <= cnt; i++)
    if ((i != x) && (i != y)) {
      double t = val(c[x], c[y], c[i]);
      if (side(c[x], c[y], c[i]))
        l = max(l, t);
      else
        r = min(r, t);
    }
  for (int i = 1; i <= m; i++)
    if (((c[x] - b[i]) ^ (c[y] - b[i])) == 0) {
      if (((c[x] - b[i]) & (b[i] - c[y])) > 0) return;
    } else {
      double t = val(c[x], c[y], b[i]);
      if (side(c[x], c[y], b[i]))
        r = min(r, t);
      else
        l = max(l, t);
      if (r - l < eps) return;
    }
  if (r - l > eps) {
    puts("YES");
    exit(0);
  }
}
void work(int l, int r) {
  if (l + 1 >= r) return;
  double mx = -inf;
  int x = 0;
  for (int i = l + 1; i < r; i++) {
    double t = val(c[l], c[r], c[i]);
    if (mx < t) mx = t, x = i;
  }
  check(l, x);
  check(x, r);
  work(l, x);
  work(x, r);
}
void getconvex(vec *a, int n) {
  cnt = 0;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    vec cur = a[i];
    while ((cnt > 1) && side(c[cnt - 1], c[cnt], cur)) cnt--;
    c[++cnt] = cur;
  }
  int las = cnt;
  for (int i = n - 1; i; i--) {
    vec cur = a[i];
    while ((cnt > las) && side(c[cnt - 1], c[cnt], cur)) cnt--;
    c[++cnt] = cur;
  }
  cnt--;
}
void solve() {
  getconvex(a, n);
  check(1, cnt);
  work(1, cnt);
}
int main() {
  n = read();
  m = read();
  if ((n == 1) || (m == 1)) {
    puts("YES");
    return 0;
  }
  for (int i = 1; i <= n; i++) a[i].x = read(), a[i].y = read();
  for (int i = 1; i <= m; i++) b[i].x = read(), b[i].y = read();
  solve();
  swap(a, b);
  swap(n, m);
  solve();
  puts("NO");
  return 0;
}
