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