#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  int** dplane = new int*[n + 1];
  for (int i = 0; i <= n; i++) dplane[i] = new int[n + 1];
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++) dplane[i][j] = 0;
  for (int i = 0; i <= d; i++) {
    for (int j = 0; j <= n - d; j++) dplane[i + j][j + d - i] = 1;
    if (i == d) break;
    for (int j = 0; j <= n - d - 1; j++) dplane[i + j + 1][j + d - i] = 1;
  }
  int* req = new int[m];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    req[i] = dplane[x][y];
  }
  for (int i = 0; i < m; i++) cout << (req[i] == 1 ? "YES" : "NO") << endl;
  return 0;
}
