#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 9;
const int inf = 0x3f3f3f3f;
int n, d, m;
inline int read() {
  int a = 1, b = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') a = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    b = (b << 1) + (b << 3) + c - '0';
    c = getchar();
  }
  return a * b;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  int xx, yy;
  n = read(), d = read();
  m = read();
  while (m--) {
    xx = read(), yy = read();
    if (-xx + d <= yy && -xx + 2 * n - d >= yy && xx - d <= yy &&
        xx + d >= yy) {
      puts("YES");
    } else
      puts("NO");
  }
  return 0;
}
