#include <bits/stdc++.h>
using namespace std;
int INF = 2000 * 1000 * 1000;
int main() {
  int n, m, k, a, b, res = INF;
  cin >> n >> m >> k;
  for (int i = 0; i < k; ++i) {
    cin >> a >> b;
    res = min(res, min(n - a, min(a - 1, min(m - b, b - 1))));
  }
  if (res > 4)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
