#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int pie = 0, c1 = 1, c2 = n, r1 = 1, r2 = m;
  for (int i = 0; i < k; i++) {
    int p, q;
    cin >> p >> q;
    if (p - c1 >= 5 && c2 - p >= 5 && r2 - q >= 5 && q - r1 >= 5) {
    } else
      pie = 1;
  }
  if (pie == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
