#include <bits/stdc++.h>
using namespace std;
long n, m, k, ans, a, b;
long gd() {
  long res = min(a, n - a + 1);
  res = min(res, min(b, m - b + 1));
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  ans = 0;
  for (int i = 1; i <= k; i++) {
    cin >> a >> b;
    if (gd() <= 5) ans = 1;
  }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  cin.get();
  cin.get();
  return 0;
}
