#include <bits/stdc++.h>   using namespace std;   int n, m, k;   int main() {     scanf( %d %d %d , &n, &m, &k);     for (int i = 0; i < k; ++i) {       int x, y;       scanf( %d %d , &x, &y);       x = min(x - 1, n - x);       y = min(y - 1, m - y);       if (min(x, y) <= 4) {         printf( YES );         return 0;       }     }     printf( NO );     return 0;   };   