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>
import math


class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def dist(self, other):  # Расстояние от точки до точки
        x = other.x - self.x
        y = other.y - self.y
        return math.hypot(x, y)

    def __add__(self, other):  # [+] Сдвигаем точку на вектор
        return Point(self.x + other.x, self.y + other.y)

    def __sub__(self, other):  # [-] Сдвигаем точку на вектор
        return Point(self.x - other.x, self.y - other.y)

    def print(self):
        print(self.x, self.y)


class Vector():
    def __init__(self, begin=Point(0, 0), end=Point(0, 0)):
        self.x = end.x - begin.x
        self.y = end.y - begin.y
        self.begin = begin
        self.end = end

    def scalar(self, other):  # Скалярное произведение векторов
        return other.x * self.x + other.y * self.y

    def product(self, other):  # Векторное произведение векторов
        return self.x * other.y - self.y * other.x

    def lenght(self):  # Длина вектора
        return math.hypot(self.x, self.y)

    def __add__(self, other):  # Сложение векторов
        buff = Vector()
        buff.y = self.y + other.y
        buff.x = self.x + other.x
        return buff

    def __mul__(self, k):  # Умножение вектора на константу
        buff = self
        buff.y *= k
        buff.x *= k
        return buff

    def atan2(self, other):
        return math.atan2(self.product(other), self.scalar(other))


class Line():
    def __init__(self, one, two):
        self.a = two.y - one.y
        self.b = one.x - two.x
        self.c = one.y * (two.x - one.x) - self.a * one.x
        self.begin = one
        self.end = two

    def lenght(self):  # Длина отрезка
        x = self.end.x - self.begin.x
        y = self.end.y - self.begin.y
        return math.hypot(x, y)

    def point_in_line(self, other):  # Принадлежит ли точка прямой
        A = Vector(self.begin, other)
        B = Vector(self.begin, self.end)
        if (abs(B.product(A)) <= 1e-6):
            return True
        return False

    def point_in_ray(self, other):  # Принадлежит ли точка лучу
        A = Vector(self.begin, other)
        B = Vector(self.begin, self.end)

        if (abs(B.product(A)) <= 1e-6 and B.scalar(A) >= 0):
            return True
        return False

    def point_in_section(self, other):  # Принадлежит ли точка отрезку
        A = Vector(self.begin.x, other)
        B = Vector(self.begin, self.end)

        if (abs(B.product(A)) <= 1e-6 and B.scalar(A) >= 0 and B.lenght() >= A.lenght()):
            return True
        return False

    def dist_point_to_line(self, other):  # Расстояние от точки до прямой
        A = Vector(self.begin, other)
        B = Vector(self.begin, self.end)
        if (B.lenght() != 0):
            return abs(A.product(B)) / B.lenght()
        else:
            return other.dist(self.begin)

    def dist_point_to_ray(self, other):  # Расстояние от точки до луча
        A = Vector(self.begin, other)
        B = Vector(self.begin, self.end)
        if (A.scalar(B) >= 0):
            return self.dist_point_to_line(other)
        return self.begin.dist(other)

    def dist_point_to_section(self, other):  # Расстояние от точки до отрезка
        A1 = Vector(self.begin, other)
        B1 = Vector(self.begin, self.end)
        A2 = Vector(self.end, other)
        B2 = Vector(self.end, self.begin)

        if (A1.scalar(B1) >= 0 and A2.scalar(B2) >= 0):
            return self.dist_point_to_line(other)
        return min(self.begin.dist(other), self.end.dist(other))

    def check_two_points_is_between(self, one, two):  # Находятся ли две точки по разные стороны от нашего отрезка
        Main = Vector(self.begin, self.end)
        A = Vector(self.begin, one)
        B = Vector(self.begin, two)

        check1 = Main.product(A)
        check2 = Main.product(B)

        if ((check1 >= -1e6 and check2 <= 1e-6) or (check1 <= 1e-6 and check2 >= -1e-6)):
            return True
        return False

    def enter_with_section(self, other):  # Пересекаются ли отрезки
        A = self.check_two_points_is_between(other.begin, other.end)
        B = other.check_two_points_is_between(self.begin, self.end)
        if (A == True and B == True):
            return True
        return False

    def dist_with_section(self, other):  # Расстояния между отрезками
        if (self.enter_with_section(other)):
            return 0
        else:
            a = self.dist_point_to_section(other.begin)
            b = self.dist_point_to_section(other.end)
            c = other.dist_point_to_section(self.begin)
            d = other.dist_point_to_section(self.begin)
            return min(a, b, c, d)

    def get_normal(self):  # Получаем нормированный вектор нормали
        a = Vector()
        if (self.lenght() != 0):
            a.x = self.a / self.lenght()
            a.y = self.b / self.lenght()
        return a

    def get_cord_base_normal(self, other):  # Получить координату основания высоты из точки к нашей прямой
        dist = self.dist_point_to_line(other)
        k = dist / self.get_normal().lenght()
        A = other + self.get_normal() * k
        B = other - self.get_normal() * k
        if (self.point_in_line(A)):
            return A
        return B

    def get_cord_enter_with_section(self, other):  # Получить координаты пересечения двух отрезков
        if (self.enter_with_section(other)):
            if (self.b != 0 and other.b != 0):
                k1 = self.a / self.b
                b1 = self.c / self.b

                k2 = other.a / other.b
                b2 = other.c / other.b
                x = (b2 - b1) / (k1 - k2)
                y = x * k1 + b1
                return Point(x, y)
        return None


class Circle():
    def __init__(self, begin, r):
        self.begin = begin
        self.r = r

    def area(self):
        return math.pi * (self.r ** 2)


n,d = map(int , input().split())

a1 = Point(0, d)
a2 = Point(d , 0)
a3 = Point(n , n - d)
a4 = Point(n - d, n)
arr = [Vector(a1, a2), Vector(a2, a3), Vector(a3, a4), Vector(a4 , a1)]




k  = int(input())
for i in range(k):
    flag = True
    a, b = map(int , input().split())
    for j in arr:
        c = Vector(j.begin,  Point(a, b))
        if(j.product(c) < 0):
            flag = False
    if(flag):
        print('YES')
    else:
        print('NO')

