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