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