#include <bits/stdc++.h>
using namespace std;
int n, m, _n, _m;
struct DOT {
  double x, y;
  DOT(double _x = 0, double _y = 0) { x = _x, y = _y; }
} a[10100], b[10100], ha[10100], hb[10100];
DOT operator+(DOT a, DOT b) { return DOT(a.x + b.x, a.y + b.y); }
DOT operator-(DOT a, DOT b) { return DOT(a.x - b.x, a.y - b.y); }
DOT operator*(DOT a, double k) { return DOT(a.x * k, a.y * k); }
double dtime(DOT a, DOT b) { return a.x * b.x + a.y * b.y; }
double ctime(DOT a, DOT b) { return a.x * b.y - a.y * b.x; }
double len(DOT a) { return sqrt(dtime(a, a)); }
double len2(DOT a) { return dtime(a, a); }
int dcmp(double a) {
  if (fabs(a) < (1e-10)) return 0;
  return a < 0 ? -1 : 1;
}
bool cmp(DOT a, DOT b) {
  return dcmp(a.x - b.x) < 0 || (dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y) < 0);
}
void hull(DOT* a, int n, DOT* b, int& m) {
  sort(a + 1, a + n + 1, cmp);
  m = 0;
  for (int i = 1, _E_ = n; i <= _E_; ++i) {
    while (m > 1 && dcmp(ctime(b[m] - b[m - 1], a[i] - b[m - 1])) <= 0) --m;
    b[++m] = a[i];
  }
  int k = m;
  for (int i = n - 1, _E_ = 1; i >= _E_; --i) {
    while (m > k && dcmp(ctime(b[m] - b[m - 1], a[i] - b[m - 1])) <= 0) --m;
    b[++m] = a[i];
  }
  if (m > 1) --m;
}
DOT core(DOT a, DOT b, DOT c) {
  DOT A = DOT(b.x - a.x, c.x - a.x) * 2, B = DOT(b.y - a.y, c.y - a.y) * 2;
  DOT C = DOT(len2(b) - len2(a), len2(c) - len2(a));
  return DOT(ctime(B, C) / ctime(B, A), ctime(A, C) / ctime(A, B));
}
bool check(DOT* a, int n, DOT* b, int m, int h, int t) {
  if (n == 1) return 1;
  int mid = 0;
  DOT o = (a[h] + a[t]) * 0.5;
  double mn = -1e16, mx = 1e16;
  for (int i = h + 1, _E_ = t; i < _E_; ++i) {
    DOT c = core(a[i], a[h], a[t]);
    double l = len(c - o);
    if (dcmp(ctime(a[t] - a[h], c - a[h])) > 0) l = -l;
    if (dcmp(l - mn) > 0) mn = l, mid = i;
  }
  for (int i = t; (i = i % n + 1) != h;) {
    DOT c = core(a[i], a[h], a[t]);
    double l = len(c - o);
    if (dcmp(ctime(a[t] - a[h], c - a[h])) > 0) l = -l;
    if (dcmp(l - mx) < 0) mx = l;
  }
  bool res = 1;
  for (int i = 1, _E_ = m; i <= _E_; ++i) {
    if (dcmp(ctime(a[t] - a[h], b[i] - a[h])) == 0) {
      if (dcmp(dtime(b[i] - a[h], b[i] - a[t])) < 0) {
        res = 0;
        break;
      }
    }
    DOT c = core(b[i], a[h], a[t]);
    double l = len(c - o);
    if (dcmp(ctime(a[t] - a[h], c - a[h])) > 0) l = -l;
    if (dcmp(ctime(a[t] - a[h], b[i] - a[h])) > 0 && dcmp(l - mn) > 0) mn = l;
    if (dcmp(ctime(a[t] - a[h], b[i] - a[h])) < 0 && dcmp(l - mx) < 0) mx = l;
    if (dcmp(mx - mn) <= 0) {
      res = 0;
      break;
    }
  }
  return res ||
         (mid && (check(a, n, b, m, h, mid) || check(a, n, b, m, mid, t)));
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1, _E_ = n; i <= _E_; ++i) scanf("%lf %lf", &a[i].x, &a[i].y);
  for (int i = 1, _E_ = m; i <= _E_; ++i) scanf("%lf %lf", &b[i].x, &b[i].y);
  hull(a, n, ha, _n);
  hull(b, m, hb, _m);
  if (check(ha, _n, b, m, 1, _n) || check(hb, _m, a, n, 1, _m))
    printf("YES");
  else
    printf("NO");
  return 0;
}
