#include <bits/stdc++.h>
using namespace std;
double kra(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
double plo(double a, double b, double c) {
  if (abs(a + b - c) < 0.00001 || abs(a + c - b) < 0.00001 ||
      (b + c - a) < 0.00001)
    return 0;
  double p = (a + b + c) / 2.;
  return sqrt(p * (p - a) * (p - b) * (p - c));
}
int main() {
  int n, x, y, a, b;
  cin >> a >> b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    double a1, a2, a3, a4, a5, a6, a7, a8, s1, s2, s3, s4, s;
    s = kra(0, b, b, 0) * kra(0, b, a - b, a);
    a1 = kra(0, b, b, 0);
    a2 = kra(0, b, a - b, a);
    a3 = a1;
    a4 = a2;
    a5 = kra(0, b, x, y);
    a6 = kra(a - b, a, x, y);
    a7 = kra(a, a - b, x, y);
    a8 = kra(b, 0, x, y);
    s1 = plo(a1, a5, a8);
    s2 = plo(a2, a5, a6);
    s3 = plo(a6, a7, a3);
    s4 = plo(a4, a7, a8);
    if (abs(s1 + s2 + s3 + s4 - s) < 0.0000001)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
