#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long N = 1e6 + 10;
const long long inf = (long long)1e18 + 10ll;
const long long mod = 1e9 + 7;
const double eps = 1e-6;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
using namespace std;
long long n, d;
long long q;
pair<long long, long long> calc(long long first) {
  pair<long long, long long> p;
  p.first = abs(first - d);
  p.second = n - abs(first - (n - d));
  return p;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d;
  cin >> q;
  while (q--) {
    long long first, second;
    cin >> first >> second;
    pair<long long, long long> p = calc(first);
    if (second >= p.first && second <= p.second)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
