#include <bits/stdc++.h>
double area(int x1, int y1, int x2, int y2, int x3, int y3) {
  double a;
  a = (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0;
  a = fabs(a);
  return a;
}
int main() {
  int n, d, m, i, j;
  int** ptr;
  double a, a1, a2, a3, a4, sum;
  scanf("%d%d", &n, &d);
  scanf("%d", &m);
  ptr = (int**)malloc(m * sizeof(int*));
  for (i = 0; i < m; i++) {
    ptr[i] = (int*)malloc(2 * sizeof(int));
  }
  for (i = 0; i < m; i++) {
    for (j = 0; j < 2; j++) {
      scanf("%d", &ptr[i][j]);
    }
  }
  a = area(0, d, d, 0, n, n - d) + area(0, d, n, n - d, n - d, n);
  for (i = 0; i < m; i++) {
    a1 = area(ptr[i][0], ptr[i][1], 0, d, d, 0);
    a2 = area(ptr[i][0], ptr[i][1], d, 0, n, n - d);
    a3 = area(ptr[i][0], ptr[i][1], n, n - d, n - d, n);
    a4 = area(ptr[i][0], ptr[i][1], n - d, n, 0, d);
    sum = a1 + a2 + a3 + a4;
    if (sum == a)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
