#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, k;
  cin >> n >> m >> k;
  int x, y;
  for (int i = 0; i < k; ++i) {
    cin >> x >> y;
    if (x <= 5 || (n - x) <= 4 || y <= 5 || m - y <= 4) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
