#include <bits/stdc++.h>
using namespace std;
int n, m, k, r, s, t;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  while (k--) {
    scanf("%d %d", &r, &s);
    r = min(r - 1, n - r);
    s = min(s - 1, m - s);
    r = min(r, s);
    if (r < 5) t = 1;
  }
  puts(t ? "YES" : "NO");
  return 0;
}
