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