#include <bits/stdc++.h>
using namespace std;
int n, d, m, tempx, tempy;
int yy(int x1, int y1, int x2, int y2, int x) {
  return (float)(x - x1) * (y1 - y2) / (x1 - x2) + y1;
}
bool pang(int x, int y) {
  if (x > n || y > n)
    return 0;
  else {
    if (yy(d, 0, 0, d, x) > y) {
      return 0;
    }
    if (yy(d, 0, n, n - d, x) > y) {
      return 0;
    }
    if (yy(n - d, n, n, n - d, x) < y) {
      return 0;
    }
    if (yy(0, d, n - d, n, x) < y) {
      return 0;
    }
    return 1;
  }
}
int main() {
  cin >> n >> d;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> tempx >> tempy;
    if (pang(tempx, tempy)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
