Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
using namespace std;
#define EPS 1e-10
#define INF 1000000
 
struct Point{
    double x,y;
    Point(){}
    Point(double _x,double _y){
        x=_x; y=_y;
    }
    Point operator +(const Point p)const{
        return Point(x+p.x,y+p.y);
    }
    Point operator -(const Point p)const{
        return Point(x-p.x,y-p.y);
    }
    Point operator *(const double d)const{
        return Point(x*d,y*d);
    }
    bool operator <(const Point &p)const{
        if(x==p.x) return y<p.y;
        return x<p.x;
    }
    double norm(){
        return x*x+y*y;
    }
	bool input(){
		if(cin>>x>>y) return true;
		return false;
	}
};
 
struct Line{
    Point a,b;
    Line(){}
    Line(Point _a,Point _b){
        a=_a; b=_b;
    }
	bool input(){
		if(a.input() && b.input()) return true;
		return false;
	}
};
 
struct Circle{
    Point c;
    double r;
    Circle(){}
    Circle(Point _c,double _r){
        c=_c; r=_r;
    }
};

typedef vector<Point> Polygon;

double dot(Point p,Point q){
    return p.x*q.x+p.y*q.y;
}
 
double cross(Point p,Point q){
    return p.x*q.y-q.x*p.y;
}
 
int ccw(Point a,Point b,Point c){ //a,b,c,縺ッ蜈ィ縺ヲ逡ー縺ェ繧?	Point v1 = b-a;
	Point v2 = c-a;
    if(cross(v1,v2)>EPS) return +1; //a->b->c 縺悟渚譎りィ亥屓繧?    if(cross(v1,v2)<-EPS) return -1; //a->b->c 縺梧凾險亥屓繧?	if(dot(v1,v2)<-EPS) return +2; //c縺径-b繧医ｊ蠕後ｍ c<-a->b
	if(v1.norm()<v2.norm()) return -2; //c縺径-b繧医ｊ蜑?a->b->c
    return 0; //c縺径-b荳?a->c->b
}
 
bool intersect_ss(Line l,Line m){
    return ccw(l.a,l.b,m.a)*ccw(l.a,l.b,m.b)<=0 && ccw(m.a,m.b,l.a)*ccw(m.a,m.b,l.b)<=0;
}
 
bool crosspoint_ll(Line l,Line m,Point &p){
    Point a1,a2,b1,b2;
    a1 = l.b-l.a; a2 = m.b-m.a;
    b1 = m.a-l.a; b2 = l.a-m.b;
    double s1,s2;
    s1 = cross(a1,b1)/2; s2 = cross(a1,b2)/2;
    if(s1+s2<EPS) return false; //蟷ウ陦?    p = Point(m.a.x+a2.x*s1/(s1+s2),m.a.y+a2.y*s1/(s1+s2));
    return true;
}
 
int crosspoint_ss(Line l,Line m,Point &p){
    if(intersect_ss(l,m)==false) return 0; //莠、蟾ョ縺励※縺?↑縺?    if(crosspoint_ll(l,m,p)==true) return 1;
	return -1; //莠、轤ケ縺檎┌髯仙?(蟷ウ陦後°縺、莠、蟾ョ)
}
 
int crosspoint_cc(Circle c1,Circle c2,Point &p1,Point &p2){
    double d,a,t;
    d = sqrt((c2.c-c1.c).norm());
	if(abs(c1.c.x-c2.c.x)<EPS && abs(c1.c.y-c2.c.y)<EPS && abs(c1.r-c2.r)<EPS)
		return -1; //2縺、縺ョ蜀?′驥阪↑縺」縺ヲ縺?ｋ
    if(d<abs(c1.r-c2.r) || c1.r+c2.r<d) return 0; //縺ゥ縺。繧峨°縺悟?蛹?＠縺ヲ縺?ｋ
    a = acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
    t = atan2(c2.c.y-c1.c.y,c2.c.x-c1.c.x);
    p1 = Point(c1.c.x+c1.r*cos(t+a),c1.c.y+c1.r*sin(t+a));
    p2 = Point(c1.c.x+c1.r*cos(t-a),c1.c.y+c1.r*sin(t-a));
    if(abs(p1.x-p2.x)<EPS && abs(p1.y-p2.y)<EPS) return 1; //莠、轤ケ縺?縺、
    return 2; //莠、轤ケ縺?縺、
}

int contains(Polygon g,Point p){
	Line l = Line(p,Point(INF,p.y));
	int cnt = 0, n = g.size();
	for(int i=0;i<n;i++){
		Point a = g[i]-p;
		Point b = g[(i+1)%n]-p;
		if(ccw(g[i],g[(i+1)%n],p)==0) return 1; //邱壼?荳?		if(a.y>b.y) swap(a,b);
		if(a.y<=EPS && EPS<b.y && cross(a,b)>EPS) cnt++;
	}
	if((cnt&1)==1) return 2; //蜀?桁縺励※縺?ｋ
	return 0; //蜀?桁縺励※縺?↑縺?}

Polygon andrewScan(Polygon s){
	if(s.size()<=2) return s;
	sort(s.begin(),s.end());
	Polygon g;
	for(int i=0;i<s.size();i++){
		for(int n=g.size(); n>=2 && ccw(g[n-2],g[n-1],s[i])!=-1; n--){
			g.pop_back();
		}
		g.push_back(s[i]);
	}
	int upper_n = g.size();
	for(int i=s.size()-2;i>=0;i--){
		for(int n=g.size(); n>upper_n && ccw(g[n-2],g[n-1],s[i])!=-1; n--){
			g.pop_back();
		}
		g.push_back(s[i]);
	}
	reverse(g.begin(),g.end());
	g.pop_back();
	return g;
}

int main(){
	int N,M;
	Polygon b,w,gb,gw;
	while(cin>>N>>M,N||M){
		b.resize(N); w.resize(M);
		for(int i=0;i<N;i++) b[i].input();
		for(int i=0;i<M;i++) w[i].input();
		gb = andrewScan(b); gw = andrewScan(w);
		bool ans = true;
		for(int i=0;i<gb.size() && ans;i++){
			for(int j=0;j<gw.size() && ans;j++){
				Line l(gb[i],gb[(i+1)%gb.size()]), m(gw[i],gw[(i+1)%gw.size()]);
				if(intersect_ss(l,m)==true) ans = false;
			}
		}
		if(gb.size()>=2){
			for(int i=0;i<M && ans;i++){
				if(contains(gb,w[i])!=0) ans = false;
			}
		}
		if(gw.size()>=2){
			for(int i=0;i<N && ans;i++){
				if(contains(gw,b[i])!=0) ans = false;
			}
		}
		if(ans==true) puts("YES");
		else puts("NO");
	}
}

Compiler output:
a.cc: In function 'int ccw(Point, Point, Point)':
a.cc:80:14: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   80 |     if(cross(v1,v2)>EPS) return +1; //a->b->c 縺悟渚譎りィ亥屓繧?    if(cross(v1,v2)<-EPS) return -1; //a->b->c 縺梧凾險亥屓繧? if(dot(v1,v2)<-EPS) return +2; //c縺径-b繧医ｊ蠕後ｍ c<-a->b
      |              ^~
      |              __pstl::execution::v1
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from a.cc:4:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:81:12: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   81 |         if(v1.norm()<v2.norm()) return -2; //c縺径-b繧医ｊ蜑?a->b->c
      |            ^~
      |            __pstl::execution::v1
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc: In function 'int contains(Polygon, Point)':
a.cc:130:30: error: a function-definition is not allowed here before '{' token
  130 | Polygon andrewScan(Polygon s){
      |                              ^
a.cc:152:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  152 | int main(){
      |         ^~
a.cc:152:9: note: remove parentheses to default-initialize a variable
  152 | int main(){
      |         ^~
      |         --
a.cc:152:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:152:11: error: a function-definition is not allowed here before '{' token
  152 | int main(){
      |           ^
a.cc:180:2: error: expected '}' at end of input
  180 | }
      |  ^
a.cc:118:32: note: to match this '{'
  118 | int contains(Polygon g,Point p){
      |                                ^