#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, N = 1e2 + 5, MOD = 1e9 + 7;
int T, cas = 0;
int n, m, k;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int ans = 0, x, y;
  for (int i = 0; i < (k); i++) {
    scanf("%d%d", &x, &y);
    if (x < 6 || x > n - 5 || y < 6 || y > m - 5) ans = 1;
  }
  printf("%s\n", ans ? "YES" : "NO ");
  return 0;
}
