#include <bits/stdc++.h>
using namespace std;
mt19937 gen(time(nullptr));
const long long INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, d;
  cin >> n >> d;
  long long m;
  cin >> m;
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    if (n - y + x < n - d || x + y < d || n - x + n - y < d ||
        n - x + y < n - d) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
