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