#include <bits/stdc++.h>
using namespace std;
long long n, nn, m, d, x, y, fl;
string s, ss;
int main() {
  cin >> n >> d >> m;
  nn = n + (n - d);
  for (long long i = 1; i <= m; i++) {
    cin >> x >> y;
    fl = 0;
    if (x + y < d || x > n || y > n || x + y > nn) {
      fl = 1;
    } else {
      if (x < y) swap(x, y);
      if (x > d) {
        long long dis = x - d;
        if (dis > y) fl = 1;
      }
    }
    (fl == 1) ? cout << "NO" << endl : cout << "YES" << endl;
  }
  return 0;
}
