#include <bits/stdc++.h>
using namespace std;
int n, m, k, x[1000], y[1000];
void fin() {
  cout << "YES";
  exit(0);
}
int dist(int x, int y) {
  int minim = min(x - 1, y - 1);
  minim = min(minim, n - x);
  minim = min(minim, m - y);
  return minim;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < k; i++)
    if (dist(x[i], y[i]) < 5) fin();
  cout << "NO";
  return 0;
}
