#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  bool win = false;
  for (int i = 0; i < k; ++i) {
    int a, b;
    cin >> a >> b;
    if ((a <= 5 || a >= n - 4) || (b <= 5 || b >= m - 4)) win = true;
  }
  if (win)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
