#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n, m, k;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  if (k == 0)
    printf("NO\n");
  else {
    int namn = N;
    int x, y;
    for (int i = 0; i < (k); ++i) {
      scanf("%d %d", &x, &y);
      namn = min(namn,
                 min(min(abs(x - 1), abs(n - x)), min(abs(y - 1), abs(m - y))));
    }
    if (namn < 5)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
