Vasya owns a cornfield which can be defined with two integers n and d. The cornfield can be represented as rectangle with vertices having Cartesian coordinates (0, d), (d, 0), (n, n - d) and (n - d, n).

<image> An example of a cornfield with n = 7 and d = 2.

Vasya also knows that there are m grasshoppers near the field (maybe even inside it). The i-th grasshopper is at the point (x_i, y_i). Vasya does not like when grasshoppers eat his corn, so for each grasshopper he wants to know whether its position is inside the cornfield (including the border) or outside.

Help Vasya! For each grasshopper determine if it is inside the field (including the border).

Input

The first line contains two integers n and d (1 ≤ d < n ≤ 100).

The second line contains a single integer m (1 ≤ m ≤ 100) — the number of grasshoppers.

The i-th of the next m lines contains two integers x_i and y_i (0 ≤ x_i, y_i ≤ n) — position of the i-th grasshopper.

Output

Print m lines. The i-th line should contain "YES" if the position of the i-th grasshopper lies inside or on the border of the cornfield. Otherwise the i-th line should contain "NO".

You can print each letter in any case (upper or lower).

Examples

Input

7 2
4
2 4
4 1
6 3
4 5


Output

YES
NO
NO
YES


Input

8 7
4
4 4
2 8
8 1
6 1


Output

YES
NO
YES
YES

Note

The cornfield from the first example is pictured above. Grasshoppers with indices 1 (coordinates (2, 4)) and 4 (coordinates (4, 5)) are inside the cornfield.

The cornfield from the second example is pictured below. Grasshoppers with indices 1 (coordinates (4, 4)), 3 (coordinates (8, 1)) and 4 (coordinates (6, 1)) are inside the cornfield. 

<image>
'''
# shapes
import turtle 
import random

wn = turtle.Screen()
wn.bgcolor('black')
wn.title('Balls')
wn.tracer()

balls = []

for _ in range(25):
    balls.append(turtle.Turtle())

colors = ['orange', 'blue', 'purple', 'yellow', 'white', 'green']
shapes = ['triangle', 'circle', 'square']

for ball in balls:    
    ball.shape(random.choice(shapes))
    ball.color(random.choice(colors))
    ball.penup()
    ball.speed(0)
    x = random.randint(-290, 290)
    y = random.randint(200, 400)
    ball.goto(x, y)
    dy = 0
    dx = random.randint(-3, 3)
    da = random.randint(-5, 5)

gravity = 0.5


while True:
    wn.update()

    for ball in balls:

        ball.rt(da)
        dy -= gravity
        ball.sety(ball.ycor() + dy)
        ball.setx(ball.xcor() + dx)
    
        #wall
        if ball.xcor() > 300:
            dx *= -1
            da *= -1
        if ball.xcor() < -300:
            dx *= -1
            da *= -1
        #bounce
        if ball.ycor() < -300:
            dy *= -1
            da *= -1

wn.mainloop()
'''
'''
import turtle
import time 


wn = turtle.Screen()
wn.bgcolor('black')
wn.title('Stoplights')

class Stoplight():
    def __init__(self, x, y):
        self.pen = turtle.Turtle()
        self.pen.width(3)
        self.pen.penup()
        self.pen.hideturtle()
        self.pen.speed(0)
        self.pen.color('yellow')
        self.pen.goto(x - 30,y + 60)
        self.pen.down()
        self.pen.fd(60)
        self.pen.rt(90)
        self.pen.fd(120)
        self.pen.rt(90)
        self.pen.fd(60)
        self.pen.rt(90)
        self.pen.fd(120)

        self.color = ''

        self.red_light = turtle.Turtle()
        self.yellow_light = turtle.Turtle()
        self.green_light = turtle.Turtle()

        self.red_light.speed(0)
        self.yellow_light.speed(0)
        self.green_light.speed(0)

        self.red_light.shape('circle')
        self.yellow_light.shape('circle')
        self.green_light.shape('circle')

        self.red_light.color('grey')
        self.yellow_light.color('grey')
        self.green_light.color('grey')

        self.red_light.penup()
        self.yellow_light.penup()
        self.green_light.penup()

        self.red_light.goto(x, y + 40)
        self.yellow_light.goto(x, y)
        self.green_light.goto(x, y - 40)

    def change_color(self, color):
        self.red_light.color('grey')
        self.yellow_light.color('grey')
        self.green_light.color('grey')

        if color == 'red':
            self.red_light.color('red')
            self.color = 'red'
        elif color == 'yellow':
            self.yellow_light.color('yellow')
            self.color = 'yellow'
        elif color == 'green':
            self.green_light.color('green')
            self.color = 'green'

    def timer(self):
        if self.color == 'red':
            self.change_color('yellow')
            wn.ontimer(self.timer, 4000)
        if self.color == 'yellow':
            self.change_color('green')
            wn.ontimer(self.timer, 2000)
        if self.color == 'green':
            self.change_color('red')
            wn.ontimer(self.timer, 1000)
    
stoplight1 = Stoplight(0, 0)
stoplight1.change_color('red')
stoplight1.timer()

stoplight2 = Stoplight(-100, 0)
stoplight2.change_color('yellow')
stoplight2.timer()

stoplight3 = Stoplight(100, 0)
stoplight3.change_color('green')
stoplight3.timer()


wn.mainloop()

from tkinter import * 

number_of_smokes = 5 # количество кружков-дымов 

x = [280.0+i*16 for i in range(number_of_smokes)] 
y = [160.0-i*32 for i in range(number_of_smokes)] 
size = [0.0+i*8 for i in range(number_of_smokes)] 


def smoke(i): 
    global x, y, size 
    can.coords(sm[i], x[i]-size[i], y[i]-size[i], x[i]+20+size[i], y[i]+20+size[i]) 
    x[i] += 1 
    y[i] -= 2 
    size[i] += 0.3 
    if x[i] >= 380: 
        x[i] = 280.0 
        y[i] = 160.0 
        size[i] = 0.0 
        can.coords(sm[i], x[i], y[i], x[i] + 20, y[i] + 20) 
    can.after(20, smoke, i) 


can = Canvas(width=500, height=500, bg="#FFF") 
can.pack() 

can.create_rectangle(280, 250, 300, 180, fill='#660000') # труба 
can.create_polygon(150, 250, 250, 170, 350, 250, fill='#800000', outline="black") # крыша 
can.create_rectangle(170, 340, 330, 250, fill='#6699FF') # стена 
can.create_rectangle(185, 310, 230, 270, fill='#999966', outline='#993300', width=2) # окно 
sm = [can.create_oval(x[i], y[i], x[i]+20, y[i]+20, fill='#B8B8B8', width=0) for i in range(number_of_smokes)] # дым 

for i in range(number_of_smokes): 
    smoke(i) 

mainloop()


import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np


mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()

x_train = tf.keras.utils.normalize(x_train, axis=1)
x_test = tf.keras.utils.normalize(x_test, axis=1)

model = tf.keras.models.Sequential() #создаем модель для того чтобы работать только с ней
model.add(tf.keras.layers.Flatten()) #делаем плоский слой 1х784
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))
model.add(tf.keras.layers.Dense(10, activation=tf.nn.softmax)) #выходной слой

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])
model.fit(x_train, y_train, epochs=3)

val_loss, val_acc = model.evaluate(x_test, y_test)

predictions = model.predict(x_test)

print(val_loss)
print(val_acc)
print(np.argmax(predictions[2]))


plt.imshow(x_test[2],cmap=plt.cm.binary)
plt.show()


import matplotlib.pyplot as plt
import numpy as np
import os
import cv2
import matplotlib.path as mpath
import matplotlib.patches as mpatches
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from matplotlib import cm
#datadir = 'D:/Datasets/PetImages/Dog'
#path = os.path.join(datadir)
fig = plt.figure()
ax = fig.gca(projection='3d')

# Make data.
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)

# Plot the surface.
surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm,
                       linewidth=0, antialiased=False)

# Customize the z axis.
ax.set_zlim(-1.01, 1.01)
ax.zaxis.set_major_locator(LinearLocator(10))
ax.zaxis.set_major_formatter(FormatStrFormatter('%.02f'))

# Add a color bar which maps values to colors.
fig.colorbar(surf, shrink=0.5, aspect=5)
fig.savefig("test.png")

plt.show()

#for img in os.listdir(path):
    #img_array = cv2.imread(os.path.join(path, img), cv2.IMREAD_GRAYSCALE)
    #plt.imshow(img_array, cmap="nipy_spectral")
    #plt.colorbar()
    #plt.show()
     #break

import matplotlib.pyplot as plt
import numpy as np

r = 0.033
m = 0.150
v0 = 20
q = 0.01
ro = 1.23
c = 0.4
g = 9.80665

def data_v(v0, ro, g):
    k = ro * c * v0 * r * r * np.pi / 2
    F, a, h, v = [], [], [0.], [v0]
    while h[-1] >= 0:
        F.append(k * abs(v[-1]) * v[-1])
        a.append(-g - F[-1] / m)
        h.append(h[-1] + v[-1] * q + a[-1] * q * q / 2)
        v.append(v[-1] + a[-1] * q)
    return F, a, h, v
F, a, h, v = data_v(v0, ro, g)

def pr(text, x):
    
    time = np.arange(0., len(x)*q, q)
    if not time.shape[0] == len(x):
        time = time[:len(x)-time.shape[0]]
    line1, = plt.plot(time, x, label=text)
    line1.set_dashes([2, 2, 10, 2])
    plt.title(text)
    plt.xlabel('Время(с)')
    plt.grid()
    plt.legend()
    plt.show()
    
pr('Скорость', v)
pr('Высота', h)
pr('Ускорение', a)
pr('Сила', F)

#import numpy as np
import matplotlib.pylab as plt
import random

pmax = 4
l = 10
tmin = 1
tmax = 9
m = 15
def bank(k):
    count = 0
    n, r, p, t, c, x = [0.], [], [], [], [], []
    for i in range(1, l+1):
        p.append(random.randint(0, pmax))
        t.append(random.randint(tmin, tmax))
        r.append(int(k / t[-1]))
        n.append(n[-1] + p[-1] - r[-1])
        if n[-1] < 0:
            n[-1] = 0
        c.append(n[-1] / k * t[-1])
        if c[-1] > m:
            count += 1
        x.append(100 - (count / l) * 100)
    return x, n

func = bank(1)

fig = plt.subplot(2,1,1)
fig.plot(func[0], label='bad time {}'.format(int(min(func[0]))))
fig.set(xlabel="L", ylabel="c(bad min)")
fig.grid()
fig.legend()

fig = plt.subplot(2,1,2)
fig.plot(func[1], color='orange', label="Posetiteli {}".format(max(func[1])))
fig.set(xlabel="L", ylabel="N")
fig.grid()
fig.legend()

plt.show()

#Кегельбан
n, k = [int(i) for i in input().split()]
I = ['I']* n
for i in range(k):
    l, r = [int(i) for i in input().split()]
    for j in range(l-1, r):
        I[j] = '.'
print(''.join(I))

#ферзи
n = 8
x = []
y = []
flag = True
for i in range(n):
    new_x, new_y = [int(i) for i in input().split()]
    x.append(new_x)
    y.append(new_y)
for i in range(n):    
    for j in range(i+1,n):
        if x[i] == x[j] or y[i] == y[j] or abs(x[i] - x[j]) == abs(y[i] - y[j]):
            flag = False
if flag:
    print("NO")
else:
    print("YES")
#сокращение дроби
a, b = [int(i) for i in input().split()]
def gdc(a, b):
    while a % b != 0:
        a, b = b, a % b
    return b
c = gdc(a, b)
print(a//c,b//c)
#сложение дробей
a, b, c, d = [int(i) for i in input().split()]

znam = b * d
chisl = a * d + c * b

def gdc(chisl,znam):
    while chisl % znam != 0:
        chisl, znam = znam, chisl % znam
    return znam
c = gdc(chisl, znam)
print(chisl//c, znam//c)
#Евклид1 НОД
a, b = int(input()), int(input())
while a != 0 and b != 0:
    if a > b:
        a %= b
    else:
        b %= a
print(a + b)
#Евклид2 НОД
a, b = int(input()), int(input())
while a != b:
    if a > b:
        a = a - b
    else:
        b = b - a
 
print (a)
#Евклид3 НОД
a, b = [int(i) for i in input().split()]
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b, a % b)
print(gcd(a,b))

                                                 #C4

s = input().split('.')[0].upper()
cnt = {c: s.count(c) for c in set(s)}
cnt = max(cnt.items())
print(cnt[0], cnt[1])


import string
s = input().split('.')[0].lower()
s = [x for x in s if x in string.ascii_lowercase]
print(s)
cnt = {c: s.count(c) for c in set(s)}
print(cnt)
cnt = sorted(cnt.items()) #key= lambda x: x[0]
print(cnt)
for i in cnt:
    print("%s %d" % (i))

N = int(input())
login = {}
for i in range(N):
    fam, name = input().split()
    if login.get(fam) == None:
        login[fam] = 1
        print(login[fam])
        print(fam)
    else:
        login[fam] += 1
        print("%s%d" % (fam, login[fam]))


import string
msg = input().split('.')[0]
print(msg)
words = msg.split()
print(words)

K = min([len(w) for w in words])
L = len(string.ascii_uppercase)
msgNew = ""
for letter in msg:
    n = string.ascii_uppercase.find(letter)
    if n >= 0:
        letter = string.ascii_uppercase[(n + L - K) % L]
    n = string.ascii_lowercase.find(letter)
    if n >= 0:
        letter = string.ascii_lowercase[(n + L - K) % L]
    msgNew += letter
print(msgNew + ".")
'''
n,d = [int(i) for i in input().split()]
m = int(input())
a = []
for i in range(0,m):
    x,y = [int(i) for i in input().split()]
    if d <= x + y and x + y <= 2*n - d and x - y <= d and x - y >= -d:
        a.append('YES')
    else:
        a.append('NO')
for i in range(len(a)):
    print(a[i])




