#include <bits/stdc++.h>
using namespace std;
using std::cin;
using std::cout;
long long MOD = 998244353;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  bool found = false;
  for (int i = 0; i < k; i++) {
    int a, b;
    cin >> a >> b;
    found |= a <= 5 || a >= n - 4 || b <= 5 || b >= m - 4;
  }
  cout << (found ? "YES" : "NO") << "\n";
  return 0;
}
