#include <bits/stdc++.h>
int main() {
  int n, d, m, i, x, y;
  scanf("%d %d", &n, &d);
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    if (x - y > d || y - x > d || x + y < d || x + y > 2 * n - d)
      printf("NO\n");
    else {
      printf("YES\n");
    }
  }
  return 0;
}
