use std::collections::BTreeMap;
use std::fmt::Display;
use std::ops::Neg;
use std::ops::Div;
use std::ops::Mul;
use std::ops::Add;
use std::ops::{AddAssign, Sub};
use std::cmp::max;
use std::collections::VecDeque;
use std::cmp::min;
use std::collections::BTreeSet;
use std::cmp::Ordering;
use std::fmt::Debug;

fn read_line() -> String {
    let mut buffer = String::new();
    std::io::stdin().read_line(&mut buffer).expect("No Line");
    buffer
}
fn read_lines<T: std::str::FromStr>(count: usize) -> Vec<T> {
    let mut buffer = String::new();
    let mut vec = Vec::with_capacity(count);
    for _ in 0 .. count {
        std::io::stdin().read_line(&mut buffer).expect("No Line");
        vec.push(buffer.trim().parse().ok().expect("Can't Parse"));
        buffer.clear();
    }
    vec
}
fn read_tabulate<R, T: Fn(&str)->R> (count: usize, transformer: T) -> Vec<R> {
    let mut buffer = String::new();
    let mut vec = Vec::with_capacity(count);
    for _ in 0 .. count {
        std::io::stdin().read_line(&mut buffer).expect("No Line");
        vec.push(transformer(buffer.trim()));
        buffer.clear();
    }
    vec
}
fn read_value<T: std::str::FromStr>() -> T {
    read_line().trim().parse().ok().unwrap()
}
fn read_values<T: std::str::FromStr>() -> Vec<T> {
    read_line().trim().split(' ').map(|x| x.parse().ok().expect("Can't Parse")).collect::<Vec<T>>()
}
macro_rules! freeze {
    ($($id:ident), *) => {
        $(let $id = $id;)*
    };
}
macro_rules! read {
    (mut $ident: ident: [$ty:ty]) => {
        let mut $ident = read_values::<$ty>();
    };
    ($ident: ident: [$block: block; $size: expr]) => {
        let $ident = (0 .. $size).into_iter().map(|_| $block).collect::<Vec<_>>();
    };
    (mut $ident: ident: [$block: block; $size: expr]) => {
        let mut $ident = (0 .. $size).into_iter().map(|_| $block).collect::<Vec<_>>();
    };
    ($ident: ident: [$ty:ty]) => {
        let $ident = read_values::<$ty>();
    };
    (mut $ident: ident: [[$ty:ty]; $size: expr]) => {
        let mut $ident = (0 .. $size).into_iter().map(|_| read_values::<$ty>()).collect::<Vec<_>>();
    };
    ($ident: ident: [[$ty:ty]; $size: expr]) => {
        let $ident = (0 .. $size).into_iter().map(|_| read_values::<$ty>()).collect::<Vec<_>>();
    };
    (mut $ident: ident: [$ty:ty; $size:expr]) => {
        let mut $ident = read_lines::<$ty>($size);
    };
    ($ident: ident: [$ty:ty; $size:expr]) => {
        let $ident = read_lines::<$ty>($size);
    };
    ($($token: tt)*) => {
        let mut iter = read_values::<String>().into_iter();
        read_from_iter!(iter; $($token)*);
    };
}
macro_rules! read_from_iter {
    ($iter:expr; mut $ident:ident:$ty:ty, $($rest:tt)*) => {
        let mut $ident = $iter.next().unwrap().parse::<$ty>().expect("Can't Parse");
        read_from_iter!($iter; $($rest)*);
    };
    ($iter:expr; $ident:ident:$ty:ty, $($rest:tt)*) => {
        let $ident = $iter.next().unwrap().parse::<$ty>().expect("Can't Parse");
        read_from_iter!($iter; $($rest)*);
    };
    ($iter:expr; mut $ident:ident:$ty:ty) => {
        let mut $ident = $iter.next().unwrap().parse::<$ty>().expect("Can't Parse");
    };
    ($iter:expr; $ident:ident:$ty:ty) => {
        let $ident = $iter.next().unwrap().parse::<$ty>().expect("Can't Parse");
    };
    ($iter: expr; ) => {};
}
struct KeyValue<K, V> {
    key: K,
    value: V
}
impl <K: PartialOrd, V> PartialEq for KeyValue<K, V> {
    fn eq(&self, other: &Self) -> bool {
        self.key.eq(&other.key)
    }
}
impl <K: PartialOrd, V> Eq for KeyValue<K, V> {}
impl <K: PartialOrd, V> PartialOrd for KeyValue<K, V> {
    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
        self.key.partial_cmp(&other.key)
    }
}
impl <K: PartialOrd, V> Ord for KeyValue<K, V> {
    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
        self.key.partial_cmp(&other.key).ok_or("Can't Compare").unwrap()
    }
}

#[derive(Copy, Clone, Debug, PartialEq)]
struct Point {
    x: f64, y: f64
}
impl Point {
    fn distance(&self, that: Point) -> f64 {
        (self.distance2(that) as f64).sqrt()
    }
    fn distance2(&self, that: Point) -> f64 {
        let dx = self.x - that.x;
        let dy = self.y - that.y;
        dx * dx + dy * dy
    }
    fn argument(&self) -> Angle {
        let len = (self.x * self.x + self.y * self.y).sqrt();
        Angle{sin: self.y / len, cos: self.x / len}
    }
    fn argument_from(&self, origin: Point) -> Angle {
        let diff = *self - origin;
        let len = diff.length();
        Angle{sin: diff.dy / len, cos: diff.dx / len}
    }
}
impl Sub for Point {
    type Output = Vector;
    fn sub(self, that: Point) -> <Self as std::ops::Sub<Point>>::Output { 
        Vector{dx: self.x - that.x, dy: self.y - that.y}
     }
}
#[derive(Copy, Clone, Debug)]
struct Vector {
    dx: f64, dy: f64
}
impl Vector {
    fn dot(&self, that: Vector) -> f64 {
        self.dx * that.dx + self.dy * that.dy
    }
    fn cross(&self, that: Vector) -> f64 {
        self.dx * that.dy - self.dy * that.dx
    }
    fn length(&self) -> f64 {
        (self.dx * self.dx + self.dy * self.dy).sqrt()
    }
    fn angle(&self, that: Vector) -> Angle {
        let len = self.length() * that.length();
        Angle{sin: self.cross(that) / len, cos: self.dot(that) / len}
    }
}
#[derive(Copy, Clone, PartialEq)]
struct Angle {
    sin: f64, cos: f64
}
impl Angle {
    fn rad(&self) -> f64 {
        if self.sin >= 0f64 {
            self.cos.acos()
        }else {
            -self.cos.acos()
        }
    }
}
impl Eq for Angle {
}
impl PartialOrd for Angle {
    fn partial_cmp(&self, rhs: &Angle) -> std::option::Option<std::cmp::Ordering> { 
        self.rad().partial_cmp(&rhs.rad())
     }
}
impl Ord for Angle {
    fn cmp(&self, other: &Angle) -> Ordering {
        self.partial_cmp(other).unwrap()
    }
    
}
impl Add for Angle {
    type Output = Angle;
    fn add(self, rhs: Angle) -> <Self as std::ops::Add<Angle>>::Output { 
        Angle{sin: self.sin * rhs.cos + self.cos * rhs.sin, cos: self.cos * rhs.cos - self.sin * rhs.sin}
     }
}
impl AddAssign for Angle {
    fn add_assign(&mut self, rhs: Angle) {
        let added = *self + rhs;
        self.sin = added.sin;
        self.cos = added.cos;
    }

}
#[derive(Copy, Clone, Debug)]
struct Circle {
    center: Point, 
    radius: f64
}
impl Circle {
    fn has_intersection(&self, that: Circle) -> bool {
        let len = self.center.distance2(that.center);
        let diff = self.radius - that.radius;
        let sum = self.radius + that.radius;
        diff * diff < len && len <= sum * sum
    }
    fn contains(&self, point: Point) -> bool {
        self.center.distance2(point) <= self.radius * self.radius
    }

}
#[derive(Copy, Clone, Debug)]
struct Edge {
    from: Point, until: Point
}
impl Edge {
    fn is_cross(&self, that: Edge) -> bool {
        let vec = self.until - self.from;
        let vec2 = that.until - that.from;
        vec.cross(that.from - self.from).signum() * vec.cross(that.until - self.from).signum() <= 0f64 &&
        vec2.cross(self.from - that.from).signum() * vec2.cross(self.until - that.from).signum() <= 0f64
    }
}
fn is_separated_by_single_circle(circles: &Vec<Circle>, point_a: Point, point_b: Point) -> bool {
    circles.iter().any(|c| c.contains(point_a) != c.contains(point_b)) 
}

fn no() {
    print!("NO");
}
fn yes() {
    print!("YES");
}
fn is_in_area(points: &Vec<Point>, point: Point) -> bool {
    let mut sum_angles = 0f64;
    for i in 0 .. points.len() {
        sum_angles += (points[i] - point).angle(points[(i + 1) % points.len()] - point).rad();
    }
    //println!("vertex: {:?}, point: {:?}, result: {:.*}, is in: {}", points, point, 2, sum_angles, sum_angles.abs() > 1e-6);
    sum_angles.abs() > 1e-6
}
fn solve(circles: Vec<Circle>, queries: Vec<(Point, Point)>) {
    let mut sorted_neighbor = vec![Vec::<usize>::new(); circles.len()];
    let mut used = vec![vec![true; circles.len()]; circles.len()];
    let mut count = 0;
    for i in 0 .. circles.len() {
        for j in 0 .. circles.len() {
            if i == j {continue;}
            if circles[i].has_intersection(circles[j]) {
                sorted_neighbor[i].push(j);
            }
        }
        sorted_neighbor[i].sort_by_key(|&j| circles[j].center.argument_from(circles[i].center));
        //println!("from: {}, to: {:?}", i, sorted_neighbor[i]);
    }
    freeze!(sorted_neighbor);
    for (point_a, point_b) in queries {
        if count > 0 {
            print!(" ");
        }
        count += 1;
        if is_separated_by_single_circle(&circles, point_a, point_b) {
            no();
            continue;
        }
        let mut outer_circle = vec![false; circles.len()];
        let mut neighbors = vec![Vec::new(); circles.len()];
        let mut edges = Vec::new();
        for i in 0 .. circles.len() {
            if !circles[i].contains(point_a) {
                outer_circle[i] = true;
            }
        }
        for i in 0 .. circles.len() {
            if outer_circle[i] {
                for j in 0 .. sorted_neighbor[i].len() {
                    if outer_circle[sorted_neighbor[i][j]] {
                        used[i][sorted_neighbor[i][j]] = false;
                        neighbors[i].push(sorted_neighbor[i][j]);
                        edges.push((i, sorted_neighbor[i][j]));
                    }
                }
            }
        }
        let mut separated = false;
        for (start, to) in edges {
            if used[start][to] {continue;}
            used[start][to] = true; 
            let mut points = vec![circles[start].center];
            let mut prev = start;
            let mut current = to;
            while current != start {
                points.push(circles[current].center);
                let offset = (0 .. neighbors[current].len()).find(|&i| neighbors[current][i] == prev).unwrap();
                let next = neighbors[current][((0 .. neighbors[current].len()).find(|&d| {
                    let n = neighbors[current][(offset + d + 1) % neighbors[current].len()];
                    used[current][n] == false
                }).unwrap() + offset + 1) % neighbors[current].len()];
                used[current][next] = true;
                prev = current;
                current = next;
            }
            if is_in_area(&points, point_a) != is_in_area(&points, point_b) {
                separated = true;
                break;
            }
        }
        if separated {
            no();
        }else {
            yes();
        }
    }
    println!("");
}
fn main() {
    loop {
        read!(n: usize, m: usize); if n == 0 {break;}
        read!(circles: [{read!(x: f64, y: f64, r: f64); Circle{center: Point{x: x, y: y}, radius: r}}; n]);
        read!(queries: [{read!(px: f64, py: f64, qx: f64, qy: f64); (Point{x: px, y: py}, Point{x: qx, y: qy})}; m]);
        solve(circles, queries);
    }
}



Measured memory_bytes: 5216