#include <bits/stdc++.h>
using namespace std;
long long n, m, f, k, x, y, i, q, a[200][200];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  x = 0;
  y = m;
  if (n == 1 && m == 0) {
    a[1][1] = 1;
  } else {
    for (i = 0; i < n - m + 1; i++) {
      x = i;
      y = m + i;
      k = 0;
      while (x + k != y && y - k != x) {
        a[x + k][y - k] = 1;
        k++;
      }
      a[y][x] = 1;
      a[x][y] = 1;
      if (i + 1 < n - m + 1) {
        x = i + 1;
        y = m + i;
        a[y][x] = 1;
        a[x][y] = 1;
        k = 0;
        while (x + k != y && y - k != x) {
          a[x + k][y - k] = 1;
          k++;
        }
      }
    }
  }
  cin >> q;
  while (q--) {
    cin >> x >> y;
    if (!a[x][y])
      cout << "NO";
    else
      cout << "YES";
    cout << "\n";
  }
  return 0;
}
