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