func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 100005;   int n, m, k;   set<int> a[maxn], b[maxn];   set<int, greater<int> > c[maxn], d[maxn];   int main() {     scanf( %d%d%d , &n, &m, &k);     int x, y, nx, ny, lx = 0, ly = 0, rx = n + 1, ry = m + 1, dir = 1;     long long ans = 1;     for (int i = 1; i <= k; i++) {       scanf( %d%d , &x, &y);       a[x].insert(y), c[x].insert(y);       b[y].insert(x), d[y].insert(x);     }     x = 1, y = 1;     for (int i = 1;; i++) {       nx = x, ny = y;       if (dir == 1) {         auto t = a[x].lower_bound(y);         ny = ((t == a[x].end()) ? ry : min(*t, ry)) - 1, lx = x;       }       if (dir == 2) {         auto t = b[y].lower_bound(x);         nx = ((t == b[y].end()) ? rx : min(*t, rx)) - 1, ry = y;       }       if (dir == 3) {         auto t = c[x].lower_bound(y);         ny = ((t == c[x].end()) ? ly : max(*t, ly)) + 1, rx = x;       }       if (dir == 4) {         auto t = d[y].lower_bound(x);         nx = ((t == d[y].end()) ? lx : max(*t, lx)) + 1, ly = y;       }       if (x == nx && y == ny && i > 1) break;       ans += abs(nx - x) + abs(ny - y), x = nx, y = ny,                                         dir = (dir < 4) ? dir + 1 : 1;     }     if (ans == (long long)n * m - k)       printf( Yes n );     else       printf( No n );     return 0;   }   