#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  bool flag = false;
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    if (abs(x - n) <= 4 || abs(x - 1) <= 4)
      flag = true;
    else if (abs(y - m) <= 4 || abs(y - 1) <= 4)
      flag = true;
  }
  if (flag)
    puts("YES");
  else
    puts("NO");
}
