#include <bits/stdc++.h>
using namespace std;
int N, M, K;
int main() {
  int i, j, k;
  int a, b;
  bool jud = false;
  scanf("%d%d%d", &N, &M, &K);
  for (i = 0; i < K; i++) {
    scanf("%d%d", &a, &b);
    if (min(a, N + 1 - a) <= 5 || min(b, M + 1 - b) <= 5) jud = true;
  }
  if (jud)
    printf("YES\n");
  else
    printf("NO\n");
}
