#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n;
  scanf(" %d %d %d", &x, &y, &n);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf(" %d %d", &a, &b);
    vector<int> dist;
    dist.push_back(a - 1);
    dist.push_back(x - a);
    dist.push_back(b - 1);
    dist.push_back(y - b);
    sort(dist.begin(), dist.end());
    if (dist[0] <= 4) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
