#include <bits/stdc++.h>
using namespace std;
float triangleArea(int x1, int y1, int x2, int y2, int x3, int y3) {
  return abs(((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)) / 2.0);
}
int main() {
  int n, d, m, x, y;
  float recArea;
  cin >> n >> d >> m;
  recArea = 2 * d * (n - d);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    if (recArea == triangleArea(x, y, 0, d, d, 0) +
                       triangleArea(x, y, d, 0, n, n - d) +
                       triangleArea(x, y, n, n - d, n - d, n) +
                       triangleArea(x, y, 0, d, n - d, n))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
