#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 1e6+10;
const int INF = (2e9)+100;
int tr[N * 12];//应该开12倍,因为alls[N * 3]中有N * 3个点线段树需要乘上4
struct qNode
{
int x1,x2,y1,y2,type,id;
bool operator < (const qNode &A) const
{
if(y1==A.y1) return type < A.type;
return y1 < A.y1;
}
}qry[N * 3];
int alls[N * 3];//离散化x
int idx,cnt;
bool ans[N];
int n,q;
void pushup(int u)
{
tr[u] = max(tr[u<<1],tr[u<<1|1]);
}
int find(int x)
{
return lower_bound(alls+1,alls+1+cnt,x)-alls;
}
void build(int u,int l,int r)
{
tr[u]=-INF;
if(l==r) return;
int mid = (l + r) >> 1;
build(u<<1,l,mid);
build((u<<1)|1,mid+1,r);
}
void modify(int u,int l,int r,int x,int k)
{
if(l==x && r == x) tr[u] = max(tr[u],k);
else
{
int mid = (l + r) >> 1;
if(x <= mid) modify(u<<1,l,mid,x,k);
else modify((u<<1)|1,mid+1,r,x,k);
pushup(u);
}
}
int query(int u,int l,int r,int L,int R)
{
if(l >= L && r <= R) return tr[u];
int mid = (l + r) >> 1;
int res = -INF;
if(L<=mid) res = max(res,query(u<<1,l,mid,L,R));//范围不能变
if(R>mid) res = max(res,query((u<<1)|1,mid+1,r,L,R));
return res;
}
int main()
{
scanf("%d%d",&n,&q);
for(int i=1;i<=n;i++)
{
int x,y,r;
scanf("%d%d%d",&x,&y,&r);
qry[++idx] = {x,0,y-r,y+r,0,0};
alls[++cnt]=x;
}
for(int i=1;i<=q;i++)
{
int x1,x2,y1,y2,yu,yd;
scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&yd,&yu);
qry[++idx] = {x1,x2,yd,yu,1,i};
alls[++cnt]=x1;
alls[++cnt]=x2;
}
sort(qry+1,qry+idx+1);
sort(alls+1,alls+1+cnt);
cnt=unique(alls+1,alls+1+cnt)-alls-1;
build(1,1,cnt);
for(int i=1;i<=idx;i++)
{
if(!qry[i].type) modify(1,1,cnt,find(qry[i].x1),qry[i].y2);
else
{
int l = find(qry[i].x1);
int r = find(qry[i].x2);
if(l>r) swap(l,r);
int tmp = query(1,1,cnt,l,r);
ans[qry[i].id] = (tmp >= qry[i].y2);
}
}
for(int i=1;i<=q;i++)
if(ans[i]) puts("NO");
else puts("YES");
return 0;
}
~~~~~~