#include <bits/stdc++.h>
int oo = 0x3f3f3f3f;
using namespace std;
int cord(int x1, int y1, int x2, int y2, int xp, int yp) {
  int A = y1 - y2, B = x2 - x1, C = -(A * x1 + B * y1),
      D = (xp - x1) * (y2 - y1) - (yp - y1) * (x2 - x1);
  if (D > 0)
    return 2;
  else if (D == 0)
    return 1;
  else
    return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k = 0, m, d, x, y;
  cin >> n >> d >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    if (cord(d, 0, 0, d, x, y) > 0 && cord(0, d, n - d, n, x, y) > 0 &&
        cord(n - d, n, n, n - d, x, y) > 0 && cord(n, n - d, d, 0, x, y) > 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  getchar();
  getchar();
  return 0;
}
