#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int q = 0;
  if (k == 0) {
    cout << "NO";
    return 0;
  }
  int a[1000][2];
  for (int i = 0; i < k; i++) {
    cin >> a[i][0] >> a[i][1];
    int d = (a[i][0] - n) * -1;
    int x = (a[i][1] - m) * -1;
    int d1 = a[i][0] - 1;
    int x1 = a[i][1] - 1;
    if (d < 5 || x < 5 || d1 < 5 || x1 < 5) q += 1;
  }
  if (q)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
