#include <bits/stdc++.h>
using namespace std;
int n, m, k, x, y, f = 0;
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> x >> y;
    if (n - x < 5 || m - y < 5 || x <= 5 || y <= 5) f = 1;
  }
  if (f)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
