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