#include <bits/stdc++.h>
using namespace std;
vector<long double> x;
vector<long double> y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long double n, d, m;
  cin >> n >> d;
  cin >> m;
  vector<long double> x(5);
  vector<long double> y(5);
  x[0] = 0;
  y[0] = d;
  x[1] = d;
  y[1] = 0;
  x[2] = n;
  y[2] = n - d;
  x[3] = n - d;
  y[3] = n;
  x[4] = 0;
  y[4] = d;
  long double a, b;
  for (long long i = 0; i < m; ++i) {
    cin >> a >> b;
    long double ts = 0;
    for (int i = 0; i < 4; ++i) {
      ts += (abs((x[i + 1] - x[i]) * (b - y[i]) -
                 (y[i + 1] - y[i]) * (a - x[i]))) /
            2;
    }
    long double s = 2 * d * (n - d);
    if (abs(ts - s) < 0.000001)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
}
