#include <bits/stdc++.h>
using namespace std;
int k1 = -1, k2 = 1, n, d, a[500][500];
void Col(int sx, int sy, int ex, int ey) {
  if (sx == n - d && sy == n) {
    a[sx][sy] = 1;
    return;
  }
  if (ex == n && ey == n - d) k2 = -1;
  if (sx == 0 && sy == d) k1 = 1;
  for (int i = sx; i <= ex; i++) {
    a[i][sy] = 1;
  }
  Col(sx + k1, sy + 1, ex + k2, ey + 1);
}
int main() {
  int m;
  cin >> n >> d;
  Col(d, 0, d, 0);
  cin >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    if (a[x][y] == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
