#include <bits/stdc++.h>
using namespace std;
bool done[1001][1001];
double prob[1001][1001];
double solve(int w, int b) {
  if (done[w][b])
    return prob[w][b];
  else if (w < 0 || b < 0) {
    return 0;
  } else {
    double one = solve(w, b - 3), two = solve(w - 1, b - 2);
    done[w][b] = true;
    if (b < 2) {
      prob[w][b] = ((double)w) / (w + b);
    } else {
      prob[w][b] =
          ((double)w) / (w + b) +
          (((double)b) / (w + b)) * (((double)(b - 1)) / (w + b - 1)) *
              (((b - 2) * one) / (w + b - 2) + (w * two) / (w + b - 2));
    }
    return prob[w][b];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m, k;
  cin >> n >> m >> k;
  int x[k], y[k];
  int cnt = 0;
  for (int i = 0; i < k; i++) {
    cin >> x[i] >> y[i];
    if (abs(x[i] - 1) <= 4 || abs(x[i] - n) <= 4) cnt++;
    if (abs(y[i] - 1) <= 4 || abs(y[i] - m) <= 4) cnt++;
  }
  if (cnt > 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
