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