#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<int(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
typedef long double ld;
typedef complex<ld> P;
typedef vector<P> VP;
const ld eps = 1e-10, pi = acos(-1.0);

#define EQ(a,b) (abs((a)-(b))<eps)

ld dot (P a, P b) { return real(conj(a) * b); }
ld cross (P a, P b) { return imag(conj(a) * b); }

namespace std {
  bool operator<(const P &lhs, const P &rhs) {
    return lhs.real() == rhs.real() ? lhs.imag() < rhs.imag()
                                    : lhs.real() < rhs.real();
  }
}

struct L{ P a, b; };
struct C { P p; ld r; };

// counter clockwise
int ccw (P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > eps) return 1;   // counter clockwise
  if (cross(b, c) < -eps) return -1; // clockwise
  if (dot(b, c) < 0) return 2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line
  return 0;                          // a--c--b on line
}

bool isis_ll(L l, L m) {
  return abs(cross(l.b - l.a, m.b - m.a)) > eps;
}

bool isis_sp(L s, P p) {
  return abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps;
}

bool isis_ls(L l, L s) {
  ld a = cross(l.b - l.a, s.a - l.a);
  ld b = cross(l.b - l.a, s.b - l.a);
  return (a * b < eps);
}

P proj(L l, P p) {
  ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
  return l.a + t * (l.a - l.b);
}

P mirror(L l, P p) {
  return (ld)2 * proj(l, p) - p;
}

P is_ll(L s, L t){
  P sv = s.b - s.a, tv = t.b - t.a;
  return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}

bool isis_ss(L s, L t) {
  if (abs(cross(s.b - s.a, t.b - t.a)) < eps) return false;
  P p = is_ll(s, t);
  return isis_sp(s, p) && isis_sp(t, p);
}

ld dist_lp(L l, P p) {
  return abs(p - proj(l, p));
}

ld dist_ll(L l, L m) {
  return isis_ll(l, m) ? 0 : dist_lp(l, m.a);
}

ld dist_ls(L l, L s) {
  if (isis_ls(l, s)) return 0;
  return min(dist_lp(l, s.a), dist_lp(l, s.b));
}

ld dist_sp(L s, P p) {
  P r = proj(s, p);
  if (isis_sp(s, r)) return abs(r - p);
  return min(abs(s.a - p), abs(s.b - p));
}

bool isis_cc(C l, C r) {
  ld dist = abs(l.p-r.p);
  return dist < l.r + r.r && !(dist < abs(l.r-r.r));
}

int is_in_Polygon(const VP &g, P p) {
  bool in = false;
  int n = g.size();
  for (int i = 0; i < n; i++) {
    P a = g[i] - p, b = g[(i+1)%n] - p;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= 0 && 0 < imag(b))
      if (cross(a, b) < 0) in = !in;
    if (abs(cross(a, b)) < eps && dot(a, b) < eps) return 0; // on
  }
  if(in) return 1; // in
  return -1; // out
}

int main() {
  while(1) {
    int n,m;
    cin>>n>>m;
    if(!n)break;
    vector<C> vc;
    REP(i,n){
      int x,y;
      ld r;
      cin>>x>>y>>r;
      vc.push_back((C){P(x,y),r});
    }
    using Edge = pair<int, int>;
    using Edges = vector<Edge>;
    using Graph = vector<Edges>;
    Graph g(n);
    REP(i,n)REP(j,i) {
      if (isis_cc(vc[i], vc[j])) {
        g[i].emplace_back(i, j);
        g[j].emplace_back(j, i);
      }
    }
    vector<VP> polys;
    REP(i,n) {
      for (Edge e : g[i]) {
        VP poly(1, vc[i].p);
        int now = e.second;
        ld angle_s = arg(vc[i].p - vc[now].p);
        while(now != i) {// && find(ALL(poly), vc[now].p) == end(poly)) {
          poly.push_back(vc[now].p);
          vector<pair<ld, Edge>> v;
          for (Edge f : g[now]) {
            ld angle_t = arg(vc[f.second].p - vc[f.first].p);
            if (angle_t+eps < angle_s) {
              v.emplace_back(angle_s - angle_t, f);
            } else {
              v.emplace_back(2*pi + angle_s - angle_t, f);
            }
          }
          Edge ne = min_element(ALL(v))->second;
          angle_s = arg(vc[now].p - vc[ne.second].p);
          now = ne.second;
        }
        if (now == i) polys.push_back(poly);
      }
    }
    REP(i,m) {
      if (i) cout << ' ';
      int px,py,qx,qy;
      cin>>px>>py>>qx>>qy;
      P p(px,py), q(qx, qy);
      set<int> sp, sq;
      REP(j,n) {
        if (abs(p-vc[j].p) <= vc[j].r) sp.insert(j);
        if (abs(q-vc[j].p) <= vc[j].r) sq.insert(j);
      }
      if (sp.empty() && sq.empty()) {
        REP(j,polys.size()) {
          if (is_in_Polygon(polys[j], p)==1) sp.insert(j);
          if (is_in_Polygon(polys[j], q)==1) sq.insert(j);
        }
        if (sp == sq) {
          cout << "YES";
        } else {
          cout << "NO";
        }
      } else {
        if (sp == sq) {
          cout << "YES";
        } else {
          cout << "NO";
        }
      }
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3412