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 java.io.*;
import java.lang.reflect.Array;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.*;


public class Main {

    String filename = "distance";//filename here, System.in/out if no file
    FastScanner in;

    PrintWriter out;

    static double min(double a, double b) {
        if (a <= b) {
            return a;
        } else {
            return b;
        }
    }

    static int max(int a, int b) {
        if (a >= b) {
            return a;
        } else {
            return b;
        }
    }


    public static class Point {
        double x;
        double y;

        Point(double a, double b) {
            x = a;
            y = b;
        }
    }

    public static class Circle {
        Point c;
        double r;

        Circle(Point c1, double r1) {
            c = c1;
            r = r1;
        }
    }

    public static class Line {
        double a;
        double b;
        double c;

        Line(double q, double w, double e) {
            a = q;
            b = w;
            c = e;
        }
    }

    static double distal(Point o, Line l) {
        double res = 0;
        res = (l.a * o.x) + (l.b * o.y) + l.c;
        if (res < 0) {
            res = -res;
        }
        res = res / (Math.sqrt((l.a * l.a) + (l.b * l.b)));
        return res;
    }

    static Point peresechenie(Line l1, Line l2) {
        Point p = new Point(l1.a, l1.b);
        p.x = ((-1) * ((l1.c * l2.b) - (l2.c * l1.b)) / ((l1.a * l2.b) - (l2.a * l1.b)));
        p.y = ((-1) * ((l1.a * l2.c) - (l2.a * l1.c)) / ((l1.a * l2.b) - (l2.a * l1.b)));
        return p;
    }

    static double rast(Point a, Point b) {
        return Math.sqrt(((b.x - a.x) * (b.x - a.x)) + ((b.y - a.y) * (b.y - a.y)));
    }

    static double[] kas(Circle w, Point p) {
        double ar[] = new double[5];
        if (rast(p, w.c) == w.r) {
            ar[0] = 1;
            ar[1] = p.x;
            ar[2] = p.y;
            return ar;
        } else {
            if (rast(p, w.c) < w.r) {
                ar[0] = 0;
                return ar;
            } else {
                double e = Math.sqrt(((rast(p, w.c) * rast(p, w.c)) - (w.r * w.r)));
                return ar; /* tut */
            }
        }
    }

    static double geron(Point A, Point B, Point C) {
        double a = rast(B, C);
        double b = rast(A, C);
        double c = rast(A, B);
        double p = (a + b + c) / 2;
        return Math.sqrt(p * (p - a) * (p - b) * (p - c));
    }

    public static class Vector {
        double x;
        double y;

        Vector(Point a, Point b) {
            x = b.x - a.x;
            y = b.y - a.y;
        }
    }

    static double vpr(Vector a, Vector b) {
        return (a.x * b.y) - (a.y * b.x);
    }

    static double scpr(Vector a, Vector b) {
        return (a.x * b.x) + (a.y * b.y);
    }

    static double nappl(Point A, Point B, Point C) {
        Vector a = new Vector(C, B);
        Vector b = new Vector(C, A);
        return vpr(a, b) / 2;
    }

    static Line sozd(Point p1, Point p2) {
        Line l = new Line(0, 0, 0);
        l.a = -1 * (p2.y - p1.y);
        l.b = (p1.x - p2.x) * (-1);
        l.c = -(l.a * p1.x) - (l.b * p1.y);
        return l;
    }

    public static class Otrez {
        Point l;
        Point r;

        Otrez(double a, double b, double c, double d) {
            Point a1 = new Point(a, b);
            Point b1 = new Point(c, d);
            l = a1;
            r = b1;
        }
    }

    static double plmn(Point[] ar, int n) {
        double s = 0;
        for (int i = 1; i < n - 1; i++) {
            Vector a = new Vector(ar[0], ar[i]);
            Vector b = new Vector(ar[0], ar[i + 1]);
            s = s + nappl(ar[i + 1], ar[i], ar[0]);
        }
        if (s < 0) {
            s = -s;
        }
        return s;
    }

    static boolean lelitnaot(Point o, Otrez ot) {
        Vector a1 = new Vector(o, ot.l);
        Vector b1 = new Vector(o, ot.r);
        if (scpr(a1, b1) <= 0 && vpr(a1, b1) == 0) {
            return true;
        } else {
            return false;
        }
    }

    static boolean ptvnepr(Point a, Point b, Line l) {

        Line m = sozd(a, b);
        Point p = peresechenie(l, m);
        if ((a.x < p.x && p.x < b.x) || (a.x > p.x && p.x > b.x) || (a.y < p.y && p.y < b.y) || (a.y > p.y && p.y > b.y)) {
            return false;
        } else {
            return true;
        }
    }



    void solve() {
        int n = in.nextInt();
        int d = in.nextInt();
        int q1 = d;
        int q2 = 2 * n - d;
        int w1 = -d;
        int w2 = d;
        int m = in.nextInt();
        int a[][] = new int[m][2];
        for (int i = 0; i < m; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            int d1 = x + y;
            int d2 = y - x;
            if (d1 >= q1 && d1 <= q2 && d2 >= -d && d2 <= d) {
                out.println("YES");
            }
            else
                out.println("NO");
        }

    }

    /* To strah i toska, to bessilnaya yarost,
       to sleozi i bol napolnyayut chasi. */


    void run() throws IOException {
        InputStream input = System.in;
        OutputStream output = System.out;
        try {
            File f = new File(filename + ".in");
            if (f.exists() && f.canRead()) {
                input = new FileInputStream(f);
                output = new FileOutputStream(filename + ".out");
            }
        } catch (IOException e) {
        }
        in = new FastScanner(input);
        out = new PrintWriter(new BufferedOutputStream(output));
        solve();
        in.close();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Main().run();
    }

    class FastScanner implements Closeable {
        private BufferedReader br;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream stream) throws FileNotFoundException {
            br = new BufferedReader(new InputStreamReader(stream));
        }

        public boolean hasNext() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    String s = br.readLine();
                    if (s == null) {
                        return false;
                    }
                    tokenizer = new StringTokenizer(s);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.hasMoreTokens();
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        @Override
        public void close() throws IOException {
            br.close();
        }
    }
}

