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