#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1), eps = 1e-6, INF = 1e16;
bool isEqual(long double x, long double y) { return fabs(x - y) < eps; }
int sgn(long double sc) {
  if (isEqual(sc, 0)) return 0;
  if (sc < eps) return -1;
  return 1;
}
struct pnt {
  long double x, y;
  pnt() {}
  pnt(long double _x, long double _y) {
    x = _x;
    y = _y;
  }
  pnt(pnt A, pnt B) {
    x = B.x - A.x;
    y = B.y - A.y;
  }
  pnt operator+(pnt p) { return pnt(x + p.x, y + p.y); }
  pnt operator-(pnt p) { return pnt(x - p.x, y - p.y); }
  void operator+=(pnt p) { x += p.x, y += p.y; }
  void operator-=(pnt p) { x -= p.x, y -= p.y; }
  pnt operator*(long double sc) { return pnt(x * sc, y * sc); }
  pnt operator/(long double sc) { return pnt(x / sc, y / sc); }
  long double operator*(pnt p) { return x * p.x + y * p.y; }
  long double operator^(pnt p) { return x * p.y - p.x * y; }
  bool operator==(pnt p) { return isEqual(x, p.x) && isEqual(y, p.y); }
  bool operator!=(pnt p) { return !isEqual(x, p.x) || !isEqual(y, p.y); }
  void normalize() {
    long double sq = sqrt(x * x + y * y);
    x /= sq;
    y /= sq;
    return;
  }
  long double dist2(pnt p) {
    return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
  }
  long double dist(pnt p) { return sqrt(dist2(p)); }
  bool isParallel(pnt p) { return isEqual(pnt(x, y) ^ p, 0); }
};
struct line {
  long double a, b, c;
  line() {}
  line(long double _a, long double _b, long double _c) {
    a = _a, b = _b, c = _c;
  }
  line(pnt p1, pnt p2) {
    a = p1.y - p2.y;
    b = p2.x - p1.x;
    c = -(a * p1.x + b * p1.y);
  }
  pnt getPerpendicularVector() { return pnt(a, b); }
  pnt getParallelVector() { return pnt(-b, a); }
  line getPerpendicularLine() { return line(-b, a, c); }
  bool isParallel(line l) {
    return getParallelVector().isParallel(l.getParallelVector());
  }
  pnt intersect(line l) {
    if (isParallel(l)) {
      return pnt(INF, INF);
    }
    long double q = a * l.b - b * l.a;
    return pnt((b * l.c - c * l.b) / q, (c * l.a - a * l.c) / q);
  }
  long double dist(pnt p) {
    return fabs(a * p.x + b * p.y + c) / sqrt(a * a + b * b);
  }
  pnt basePerp(pnt p) {
    return intersect(line(p, p + getPerpendicularVector()));
  }
  bool isOnLine(pnt p) { return isEqual(a * p.x + b * p.y + c, 0); }
};
int main() {
  int n, d;
  cin >> n >> d;
  pnt A(0, d), B(d, 0), C(n, n - d), D(n - d, n);
  pnt BA(B, A), BC(B, C), CD(C, D), DA(D, A), AC(A, C), DC(D, C);
  line BAl(B, A), BCl(B, C), CDl(C, D), DAl(D, A), ACl(A, C);
  int m, x, y;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    pnt kuz(x, y), Bkuz(B, kuz), Dkuz(D, kuz);
    if ((((BA ^ Bkuz) < 0 && (BC ^ Bkuz) > 0) &&
         (((DA ^ Dkuz) > 0) && ((DC ^ Dkuz) < 0))) ||
        BAl.isOnLine(kuz) || BCl.isOnLine(kuz) || CDl.isOnLine(kuz) ||
        DAl.isOnLine(kuz)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
