#include <bits/stdc++.h>
int const N = 6 * 1e4 + 5;
using namespace std;
long double n, d, m;
complex<long double> c1, c2, c3, c4;
long double calc(complex<long double> a, complex<long double> b,
                 complex<long double> c) {
  return .5 * abs(a.real() * (b.imag() - c.imag()) -
                  a.imag() * (b.real() - c.real()) +
                  (b.real() * c.imag() - b.imag() * c.real()));
}
int main() {
  cin >> n >> d >> m;
  c1 = complex<long double>(0, d), c2 = complex<long double>(d, 0),
  c3 = complex<long double>(n, n - d), c4 = complex<long double>(n - d, n);
  long double area = (abs(c1 - c2) * abs(c3 - c2));
  while (m--) {
    long double x, y;
    cin >> x >> y;
    complex<long double> c = complex<long double>(x, y);
    long double a1 = calc(c, c1, c2), a2 = calc(c, c2, c3),
                a3 = calc(c, c3, c4), a4 = calc(c, c4, c1);
    long double total = a1 + a2 + a3 + a4;
    if (abs(area - total) < 1e-7)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
