#include<cstdio>
#include<vector>
#include<complex>
#include<cmath>
#include<algorithm>

using namespace std;

const double eps=1e-9;

typedef complex<int> Point;
typedef complex<int> Vector;
typedef vector<Point> Polygon;

double abs(Point p){
	return sqrt(p.real()*p.real()+p.imag()*p.imag());
}

struct Circle{
	Point center;
	int r;
	Circle(){}
	Circle(Point center,int r):center(center),r(r){}
	bool isin(Point p){
		double d=abs(p-center);
		return r>d;
	}
	bool isin(Circle c){
		double d=abs(c.center-center)+c.r;
		return r>d;
	}
	bool intersect(Circle c){
		double d=abs(c.center-center);
		return r+c.r>d;
	}
};

Circle circles[110];
int N;
vector<Circle> validCircles;
vector<Point> pts;
int V;

vector<bool> getCirclesStatus(Point p){
	vector<bool> res;
	for(int i=0;i<N;i++){
		res.push_back(circles[i].isin(p));
//		printf("%f %f\n",abs(circles[i].center-p),(double)circles[i].r);
	}
	return res;
}

void getValidCircles(){
	for(int i=0;i<N;i++){
		bool flg=true;
		for(int j=0;j<N;j++){
			if(i==j) continue;
			if(circles[j].isin(circles[i])){
				flg=false;
			}
		}
		if(flg){
			validCircles.push_back(circles[i]);
			pts.push_back(circles[i].center);
		}
	}
	V=validCircles.size();
}
/*
struct edge{
	int to,rev;
	edge(){}
	edge(int a,int b):to(a),rev(b){}
};*/

//vector<edge> G[110];
vector<int> G[110];
vector<bool> used[110];

void getGraph(){
	for(int i=0;i<V;i++){
		for(int j=i+1;j<V;j++){
			if(validCircles[i].intersect(validCircles[j])){
			//	G[i].push_back(edge(j,G[j].size()));
			//	G[j].push_back(edge(i,G[i].size()-1));
				G[i].push_back(j);
				G[j].push_back(i);
				used[i].push_back(false);
				used[j].push_back(false);
			}
		}
	}
//	for(int i=0;i<V;i++){
//		printf("%d--",i);
//		for(int j=0;j<G[i].size();j++){
//			printf("%d ",G[i][j]);
//		}
//		printf("\n");
//	}
}

Point center;
/*bool operator<(const edge &e1,const edge &e2){
	Vector v1=pts[e1.to]-center;
	Vector v2=pts[e2.to]-center;
	double ang1=atan2(v1.imag(),v1.real());
	double ang2=atan2(v2.imag(),v2.real());
	return ang1<ang2;
}*/

bool cmp(const int &i1,const int &i2){
	Vector v1=pts[i1]-center;
	Vector v2=pts[i2]-center;
	double ang1=atan2(v1.imag(),v1.real());
	double ang2=atan2(v2.imag(),v2.real());
	return ang1<ang2;
}

vector<Polygon> polys;

//void stroke(Polygon &poly,int cur,int rev);
void stroke(Polygon &poly,int prev,int cur,int st1,int st2);

void getPolygons(){
	for(int i=0;i<V;i++){
		center=pts[i];
		sort(G[i].begin(),G[i].end(),cmp);
	}
	for(int i=0;i<V;i++){
		for(int j=0;j<G[i].size();j++){
			if(used[i][j]) continue;
			Polygon poly;
		//	stroke(poly,G[i][j].to,G[i][j].rev);
			stroke(poly,i,G[i][j],i,G[i][j]);
			polys.push_back(poly);
		}
	}
}
/*
void stroke(Polygon &poly,int cur,int rev){
	poly.push_back(pts[cur]);
	int nxt=(rev+1)%G[cur].size();
	if(used[cur][nxt]) return;
	used[cur][nxt]=true;
	stroke(poly,G[cur][nxt].to,G[cur][nxt].rev);
}*/
void stroke(Polygon &poly,int prev,int cur,int st1,int st2){
	poly.push_back(pts[cur]);
	center=pts[cur];
	int id=distance(G[cur].begin(),lower_bound(G[cur].begin(),G[cur].end(),prev,cmp));
	int nxtId=(id+1)%G[cur].size();
	int nxt=G[cur][nxtId];
	if(st1==cur&&st2==nxt) return;
	used[cur][nxtId]=true;
	stroke(poly,cur,nxt,st1,st2);
}

int crP(Vector a,Vector b){
	return (conj(a)*b).imag();
}

bool isin(Polygon poly,Point pt){/*ONは判定していない*/
	bool in=false;
	for(int i=0;i<poly.size();i++){
		Point a=poly[i],b=poly[(i+1)%poly.size()];
		a-=pt,b-=pt;
		if(a.imag()>b.imag()) swap(a,b);
		if(a.imag()<=0&&0<b.imag()){
			if(crP(a,b)<0) in=!in;
		}
	}
	return in;
}

vector<bool> getPolygonsStatus(Point p){
	vector<bool> res;
	for(int i=0;i<polys.size();i++){
		bool flg=isin(polys[i],p);
		res.push_back(flg);
	}
	return res;
}

void print(Polygon poly){
	for(int i=0;i<poly.size();i++){
		Point pt=poly[i];
		printf("(%d,%d)-",pt.real(),pt.imag());
	}
	printf("\n");
}

void solve(Point p1,Point p2){
	vector<bool> c1,c2;
	c1=getCirclesStatus(p1);
	c2=getCirclesStatus(p2);
/*	printf("c1=");
	for(int i=0;i<N;i++) printf("%d",c1[i]?1:0);
	printf("\n");
	printf("c2=");
	for(int i=0;i<N;i++) printf("%d",c2[i]?1:0);
	printf("\n");*/
	if(c1!=c2){
		printf("NO");
		return;
	}
	for(int i=0;i<N;i++){
		if(c1[i]){
			printf("YES");
			return;
		}
	}/*
	printf("UNKNOWN");*/
	c1.clear();
	c2.clear();
	c1=getPolygonsStatus(p1);
	c2=getPolygonsStatus(p2);
	if(c1==c2){
		printf("YES");
	}else{
		printf("NO");
	}
}

void init(){
	validCircles.clear();
	pts.clear();
	polys.clear();
	for(int i=0;i<N;i++){
		G[i].clear();
		used[i].clear();
	}
}

int main(){
	while(true){
		int M;
		scanf("%d%d",&N,&M);
		if(N==0) break;
		init();
		for(int i=0;i<N;i++){
			int x,y,r;
			scanf("%d%d%d",&x,&y,&r);
			circles[i]=Circle(Point(x,y),r);
		}
		getValidCircles();
	//	for(int i=0;i<V;i++) printf("%d:(%d,%d)\n",i,pts[i].real(),pts[i].imag());
		getGraph();
		getPolygons();
	//	for(int i=0;i<polys.size();i++){
	//		print(polys[i]);
	//	}
		
		for(int q=0;q<M;q++){
			Point p1,p2;
			int x1,y1,x2,y2;
			scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
			p1=Point(x1,y1);
			p2=Point(x2,y2);
			solve(p1,p2);
			if(q==M-1) printf("\n");
			else printf(" ");
		}
	//	if(N==1) break;
	}
	return 0;
}

Measured memory_bytes: 1168