require 'set'
require 'matrix'
include Math

class Circle
	def initialize(*args)
		@id, @x, @y, @r = args
	end

	def cross?(other)
		(@x - other.x) ** 2 + (@y - other.y) ** 2 < (@r + other.r) ** 2
	end

	def include?(x, y)
		(@x - x) ** 2 + (@y - y) **2 < @r ** 2
	end

	def inspect
		@id
	end

	attr_reader :id, :x, :y, :r
end

EPS = 1e-10
class Circuit
	def initialize(circles)
		@circles = circles
	end
	def include?(x, y)
		x += EPS
		return false if @circles.any?{|c| c.include?(x, y)}
		cross_count = 0
		@circles.each_cons(2) do |c1, c2|
			next if c1.x == c2.x
			c1, c2 = c2, c1 if c2.x < c1.x
			next if x < c1.x || c2.x < x
			cy = c1.y + (c2.y - c1.y) * (x - c1.x) / (c2.x - c1.x).to_f 
			cross_count += 1 if cy > y
		end
		return cross_count.odd?
	end
end

loop do
	n, m = gets.split.map(&:to_i)
	break if n == 0

	graph = {}
	circles = (1..n).map do |i|
		c = Circle.new(i, *gets.split.map(&:to_i))
		graph[c] = []
		c 
	end

	edges = Set.new
	circles.combination(2) do |c1, c2|
		if c1.cross?(c2)
			graph[c1] << c2
			graph[c2] << c1
			edges << Set[c1, c2]
		end
	end

	#delete branches
	loop do
		c = graph.keys.min_by{|c| graph[c].size}
		if graph[c].size == 1
			graph.delete(c)
			graph.each do |u, neighbour|
				neighbour.delete(c)
			end
			edges.delete_if {|pair| pair.include?(c)}
		else
			break
		end
	end

	#find faces
	circuits = []
	scanned = {}

	loop do
		found = false
		if e0 = edges.find {|e| !scanned[[e, :left]]}
			found = true
			scanned[[e0, :left]] = 0
			u0, v0 = e0.to_a.sort_by(&:id)
			path = [u0, v0]
			u = u0
			v = v0
			until v == u0
				t = atan2(v.y - u.y, v.x - u.x)
				rot = Matrix[
					[cos(-t), -sin(-t)],
					[sin(-t), cos(-t)]
				]
				w = (graph[v] - [u]).max_by do |w|
					vec = rot * Vector[w.x - v.x, w.y - v.y]
					x, y = vec.to_a
					atan2(y, x)
				end
				e = Set[v, w]
				if v.id < w.id
					scanned[[e, :left]] = 0
				else
					scanned[[e, :right]] = 0
				end
				path << w
				u, v = v, w
			end
			# p path
			circuits << Circuit.new(path)
		end
		if e0 = edges.find {|e| !scanned[[e, :right]]}
			found = true
			scanned[[e0, :right]] = 0
			u0, v0 = e0.to_a.sort_by(&:id).reverse
			path = [u0, v0]
			u = u0
			v = v0
			until v == u0
				t = atan2(v.y - u.y, v.x - u.x)
				rot = Matrix[
					[cos(-t), -sin(-t)],
					[sin(-t), cos(-t)]
				]
				w = (graph[v] - [u]).min_by do |w|
					vec = rot * Vector[w.x - v.x, w.y - v.y]
					x, y = vec.to_a
					atan2(y, x)
				end
				e = Set[v, w]
				if v.id < w.id
					scanned[[e, :left]] = 0
				else
					scanned[[e, :right]] = 0
				end
				path << w
				u, v = v, w
			end
			# p path
			circuits << Circuit.new(path)
		end
		break if ! found
	end

	ans = []
	m.times do
		x1, y1, x2, y2 = gets.split.map(&:to_i)
		if circles.any? {|c| c.include?(x1, y1) ^ c.include?(x2, y2)}
			ans << 'NO'
		elsif circuits.any? {|c| c.include?(x1, y1) ^ c.include?(x2, y2)}
			ans << 'NO'
		else
			ans << 'YES'
		end
	end
	puts ans * ' '

end