#include <bits/stdc++.h>
int n, m, k, x, y, flag = 0;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d%d", &x, &y);
    if (n - x < 5 || m - y < 5 || x <= 5 || y <= 5) flag = 1;
  }
  printf("%s", flag ? "YES" : "NO");
}
