#include <bits/stdc++.h>
using namespace std;
int dis(int x, int n) { return min(x - 1, n - x); }
int main() {
  int n, m, k;
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    bool win = false;
    for (int i = 0; i < k; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      int d = min(dis(x, n), dis(y, m));
      if (d <= 4) win = true;
    }
    printf("%s\n", win ? "YES" : "NO");
  }
  return 0;
}
