#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, m, x[100], y[100], p, q;
  cin >> n >> d >> m;
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i];
    p = d + x[i];
    q = abs(d - x[i]);
    if (p > n) {
      p = n - (p - n);
    }
    if (x[i] <= n) {
      if (y[i] >= q && y[i] <= p) {
        cout << "YES\n";
      } else
        cout << "NO\n";
    }
  }
  return 0;
}
