#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define lb(s,x) lower_bound(all(s),x)-s.begin()
#define debug(x) cout<<#x<<": "<<x<<endl
#define INF 1e5
typedef long long ll;

typedef complex<double> Point;
typedef vector<Point> VP;
#define X real()
#define Y imag()

VP C;
vector<double> R;
vector<VP> PG;
int N,M;
const double EPS = 1e-9; // ?¨±?????????^2
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)


// // a??????b???????????¢?§??????????(0,0)???[-pi,+pi]
// double angle(Point a,Point b){
//     double t = arg(b)-arg(a);
//     while(t>+M_PI) t-=2*M_PI;
//     while(t<-M_PI) t+=2*M_PI;
//     return t;
// }

// bool inPolygon(Point p,VP& ps){
//     int n = ps.size();
//     double sumAngle=0;
//     rep(i,n){
//         Point a=ps[i]-p, b=ps[i%n]-p;
//         sumAngle += angle(a,b);
//     }
//     if(abs(sumAngle)<0.1)return false;
//     else return true;
// }

// ?????????dot(a,b) = |a||b|cos??
double dot(Point a, Point b) {
  return a.X*b.X + a.Y*b.Y;
}

// ?????????cross(a,b) = |a||b|sin??
double cross(Point a, Point b) {
  return a.X*b.Y - a.Y*b.X;
}


// ????§???¢????????¨??????
// ?????????????????¨??????1????¢?????????????2????????¨??????0?????????
bool inPolygon(Point p,const VP& ps) {
  int n = ps.size();
  bool in = false;
  rep (i, n) {
    Point a = ps[i] - p;
    Point b = ps[(i + 1) % n] - p;
    if (EQ(cross(a,b), 0) && LE(dot(a,b), 0)) return true;
    if (a.Y > b.Y) swap(a,b);
    if ((a.Y*b.Y < 0 || (a.Y*b.Y < EPS && b.Y > EPS)) && LE(cross(a, b), 0)) in = !in;
  }
  return in;
}


bool notCross(Point p,Point q){

    // p,q???????????????0???2???????????????
    // ?????????????????????p,q??§?????¨???????????°?????? ??? NO
    // p,q?????????1???2??????????????? ??? YES

    bool inAnyCircle = false;
    rep(i,N){
        inAnyCircle |= abs(C[i]-p)<R[i];
        if((abs(C[i]-p)<R[i]) != (abs(C[i]-q)<R[i])) return false;
    }
    if(inAnyCircle) return true;

    // p,q????????????????????\??£????????????
    // G??§??????????????????????§???¢PG
    // ??????????§???¢????????????p,q??§?????¨???????????°?????? ??? NO
    // ??¨??????????§???¢??§?????¨??????????????´ ??? YES
    // cout<<"?";
    
    rep(i,PG.size()){
        if(inPolygon(p,PG[i]) != inPolygon(q,PG[i])) return false;
    }
    return true;
}

// a--b--c???ccw??????????????¢?§??????????b???(0,2*pi]
double angle(Point a,Point b,Point c){
    a-=b,c-=b;
    double t = arg(a)-arg(c);
    while(t>2*M_PI) t-=2*M_PI;
    while(t<=0) t+=2*M_PI;
    return t;
}

int main(void){
    while(cin>>N>>M, N|M){
        C = VP(N);
        R = vector<double>(N);
        rep(i,N){
            double x,y;
            cin>>x>>y>>R[i];
            C[i] = {x,y};
        }

        vector<map<double,int>> G(N);
        rep(i,N)rep(j,N)if(i!=j){
            double d = abs(C[i]-C[j]);
            if(R[i]+R[j]>=d && abs(R[i]-R[j])<d){
                G[i][arg(C[j]-C[i])] = j;
                G[j][arg(C[i]-C[j])] = i;
            }
        }

        // rep(i,N){
        //     printf("from");
        //     cout<<C[i]<<endl;
        //     for(auto to:G[i]){
        //         cout<<C[to.second];
        //     }
        //     cout<<endl<<endl;
        // }

        
        PG.clear();
        rep(start,N){
            while(G[start].size()){
                // printf("before choose start\n");
                // for(auto to:G[start]){
                //     cout<<C[to.second];
                // }
                // printf("\nafter choose start\n");
                int pre = start;
                int cur = (G[start].begin())->second;
                // debug(C[pre]);
                // debug(C[cur]);
                G[start].erase(G[start].begin());
                VP poly = {C[pre]};
                while(cur!=start){
                    poly.push_back(C[cur]);
                    //????¨?????????§???????????¢?§?????°???????next????????¶
                    // debug(G[cur].size());
                    assert(G[cur].size()>0);
                    auto itr = G[cur].upper_bound(arg(C[pre]-C[cur]));
                    if(itr==G[cur].end()) {
                        itr = G[cur].begin();
                    }
                    pre = cur;
                    cur = itr->second;
                    // debug(C[cur]);

                    G[pre].erase(itr);
                }
                // printf("polygon \n");
                // for(auto p:poly) cout<<p;
                // cout<<endl;
                PG.push_back(poly);
            }
        }

        rep(i,M){
            double px,py,qx,qy;
            cin>>px>>py>>qx>>qy;
            cout<<(notCross(Point(px,py),Point(qx,qy)) ? "YES" : "NO");
            cout<<(i<M-1 ? " " : "\n");
        }
    }

    return 0;
}

Measured memory_bytes: 3416