#include <bits/stdc++.h>
using namespace std;
long long n, m, k, x, y, ans;
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  while (k--) {
    scanf("%lld%lld", &x, &y);
    if (x >= n - 4 || x <= 5 || y >= m - 4 || y <= 5) ans = 1;
  }
  puts(ans ? "YES" : "NO");
  return 0;
}
