#include <bits/stdc++.h>
using namespace std;
double st(double x1, double y1, double x2, double y2) {
  return (x1 * y2 - x2 * y1);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  double n, d;
  int m;
  cin >> n >> d >> m;
  double S = d * (n - d) * 4;
  for (int i = 0; i < m; i++) {
    double x, y, s = 0;
    cin >> x >> y;
    s += abs(st(-x, d - y, d - x, -y));
    s += abs(st(d - x, -y, n - x, n - d - y));
    s += abs(st(n - x, n - d - y, n - d - x, n - y));
    s += abs(st(n - d - x, n - y, -x, d - y));
    if (abs(S - s) <= 1e-9)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
