#include <bits/stdc++.h>
using namespace std;
void read(long long a = 0) {
  freopen("in", "r", stdin);
  if (a) freopen("out", "w", stdout);
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long done = 0;
  while (k--) {
    long long x, y;
    cin >> x >> y;
    long long mi = 1e15;
    mi = min(mi, x - 1);
    mi = min(mi, n - x);
    mi = min(mi, y - 1);
    mi = min(mi, m - y);
    done |= (mi <= 4);
  }
  if (done)
    cout << "YES";
  else
    cout << "NO";
}
