#include <bits/stdc++.h>
using namespace std;
int a, b, n;
void in() { scanf("%d%d%d", &a, &b, &n); }
void solve() {
  int x, y;
  while (n--) {
    scanf("%d%d", &x, &y);
    if (x <= 5 || x >= a - 4 || y <= 5 || y >= b - 4) {
      printf("YES\n");
      return;
    }
  }
  printf("NO\n");
}
int main() {
  in();
  solve();
  return 0;
}
