#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
int OO = 0x3f3f3f3f;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, e, m, x, y, ans1, ans2, ans3, ans4;
  cin >> n >> e >> m;
  complex<double> a(0, e), b(e, 0), c(n, n - e), d(n - e, n);
  while (m--) {
    cin >> x >> y;
    complex<double> p(x, y);
    ans1 = (conj(a - b) * (p - b)).imag();
    ans2 = (conj(d - c) * (p - c)).imag();
    ans3 = (conj(d - a) * (p - a)).imag();
    ans4 = (conj(c - b) * (p - c)).imag();
    if (((ans1 <= 0 && ans2 >= 0) || (ans1 >= 0 && ans2 <= 0)) &&
        ((ans3 <= 0 && ans4 >= 0) || (ans3 >= 0 && ans4 <= 0)))
      cout << "YES";
    else
      cout << "NO";
    cout << '\n';
  }
  return 0;
}
