#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, t;
  cin >> n >> m >> t;
  long long c = 0, d = 0;
  for (long long i = 0; i < t; ++i) {
    long long x, y;
    cin >> x >> y;
    if ((x == 1) || (y == 1) || (x == n) || (y == m)) {
      ++c;
    }
    if (((n - x) <= 4) || ((x - 1) <= 4) || ((m - y) <= 4) || ((y - 1) <= 4)) {
      ++d;
    }
  }
  if (c != 0) {
    cout << "YES";
  } else if (d != 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
