#include <bits/stdc++.h>
using namespace std;
long double dst(long double x1, long double y1, long double x2,
                long double y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
long double crossproduct(long double x1, long double y1, long double x2,
                         long double y2, long double x3, long double y3) {
  return abs((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long double n, d, m;
  cin >> n >> d >> m;
  long double x1 = 0;
  long double y1 = d;
  long double x2 = d;
  long double y2 = 0;
  long double x3 = n;
  long double y3 = n - d;
  long double x4 = n - d;
  long double y4 = n;
  long double sall = sqrt(dst(x1, y1, x2, y2) * dst(x2, y2, x3, y3)) * 2;
  for (long double i = 0; i < m; i++) {
    long double x, y;
    cin >> x >> y;
    long double s1 = crossproduct(x, y, x1, y1, x2, y2);
    long double s2 = crossproduct(x, y, x2, y2, x3, y3);
    long double s3 = crossproduct(x, y, x3, y3, x4, y4);
    long double s4 = crossproduct(x, y, x4, y4, x1, y1);
    if (s1 + s2 + s3 + s4 == sall)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
